Skip to content

Commit

Permalink
Fix sprite scaling factor when a custom size is set (#7164)
Browse files Browse the repository at this point in the history
  • Loading branch information
D8H authored Nov 14, 2024
1 parent 74a7ba5 commit a06138b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions GDJS/Runtime/spriteruntimeobject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ namespace gdjs {
}
const unscaledWidth = this._renderer.getUnscaledWidth();
if (unscaledWidth !== 0) {
this.setScaleX(newWidth / unscaledWidth);
this.setScaleX(newWidth / (unscaledWidth * this._preScale));
}
}

Expand All @@ -841,7 +841,7 @@ namespace gdjs {
}
const unscaledHeight = this._renderer.getUnscaledHeight();
if (unscaledHeight !== 0) {
this.setScaleY(newHeight / unscaledHeight);
this.setScaleY(newHeight / (unscaledHeight * this._preScale));
}
}

Expand Down

0 comments on commit a06138b

Please sign in to comment.