Skip to content

Commit

Permalink
2.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Apr 12, 2023
1 parent 939d535 commit 1f21056
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.1.5

- (Fix) Fix canvas rendering breaking due to skull overlay change in 2.14 when adjusted token setting was disabled.

# 2.1.4

- (Refinement) Adjusted token effect icons are now larger.
Expand Down
32 changes: 18 additions & 14 deletions modules/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,30 @@ Token.prototype._refreshEffects = function (...args) {
};

const origDrawOverlay = Token.prototype._drawOverlay;
Token.prototype._drawOverlay = async function (src, tint) {
Token.prototype._drawOverlay = async function (...args) {
const enabled = game.settings.get("pf2e-dorako-ui", "ux.adjust-token-effects-hud");
if (!enabled) {
origDrawOverlay.apply(this, args);
return;
}
const icon = await this._drawEffect(src, tint);
if (icon) {
const gridSize = this.scene?.grid?.size ?? 100;
const gridScale = gridSize / 100;
const tile = this.document.width;
icon.alpha = 0.8;
icon.x = 24 * gridScale * tile;
icon.y = 24 * gridScale * tile;
icon.width = 48 * gridScale * tile;
icon.height = 48 * gridScale * tile;
if (this) {
const src = args.src;
const tint = args.tint;
const icon = await this._drawEffect(src, tint);
if (icon) {
const gridSize = this.scene?.grid?.size ?? 100;
const gridScale = gridSize / 100;
const tile = this.document.width;
icon.alpha = 0.8;
icon.x = 24 * gridScale * tile;
icon.y = 24 * gridScale * tile;
icon.width = 48 * gridScale * tile;
icon.height = 48 * gridScale * tile;
}
// icon.anchor.set(0.5);
// debugger;
return icon;
}
// icon.anchor.set(0.5);
// debugger;
return icon;
};

// const origDrawEffect = Token.prototype._drawEffect;
Expand Down

0 comments on commit 1f21056

Please sign in to comment.