Skip to content

Commit

Permalink
Merge pull request #1642 from Azmoria/Beta---fix-aoe-resize-for-darkn…
Browse files Browse the repository at this point in the history
…ess-aoes

Beta - fix aoe resize for darkness aoes
  • Loading branch information
Azmoria authored Oct 21, 2023
2 parents 4df6f0b + cd6c735 commit 01fe945
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Token.js
Original file line number Diff line number Diff line change
Expand Up @@ -1519,15 +1519,29 @@ class Token {
// NEED RESIZING
old.find("img").css("--token-border-width", (this.sizeWidth() / window.CURRENT_SCENE_DATA.hpps * 2)+"px");
old.find("img").css({
"max-height": this.sizeWidth(),
"max-width": this.sizeHeight()
"max-width": this.sizeWidth(),
"max-height": this.sizeHeight()
});


old.animate({
width: this.sizeWidth(),
height: this.sizeHeight()
}, { duration: 1000, queue: false });
$(`.isAoe[data-id='${this.options.id}']:not(.token)`).css({
"max-width": this.sizeWidth()/window.CURRENT_SCENE_DATA.scale_factor,
"max-height": this.sizeHeight()/window.CURRENT_SCENE_DATA.scale_factor
})
$(`.isAoe[data-id='${this.options.id}']:not(.token) .token-image`).css({
"max-width": this.sizeWidth()/window.CURRENT_SCENE_DATA.scale_factor,
"max-height": this.sizeHeight()/window.CURRENT_SCENE_DATA.scale_factor
})

$(`.isAoe[data-id='${this.options.id}']:not(.token)`).animate({
width: this.sizeWidth()/window.CURRENT_SCENE_DATA.scale_factor,
height: this.sizeHeight()/window.CURRENT_SCENE_DATA.scale_factor
}, { duration: 1000, queue: false });

let zindexdiff=(typeof this.options.zindexdiff == 'number') ? this.options.zindexdiff : Math.round(17/(this.sizeWidth()/window.CURRENT_SCENE_DATA.hpps));
this.options.zindexdiff = Math.max(zindexdiff, -5000);
old.css("z-index", "calc(5000 + var(--z-index-diff))");
Expand All @@ -1542,6 +1556,7 @@ class Token {
old.css("font-size",fs);
}


this.update_opacity(old);

this.build_conditions(old);
Expand Down

0 comments on commit 01fe945

Please sign in to comment.