Skip to content

Commit a06138b

Browse files
authored
Fix sprite scaling factor when a custom size is set (#7164)
1 parent 74a7ba5 commit a06138b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

GDJS/Runtime/spriteruntimeobject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ namespace gdjs {
831831
}
832832
const unscaledWidth = this._renderer.getUnscaledWidth();
833833
if (unscaledWidth !== 0) {
834-
this.setScaleX(newWidth / unscaledWidth);
834+
this.setScaleX(newWidth / (unscaledWidth * this._preScale));
835835
}
836836
}
837837

@@ -841,7 +841,7 @@ namespace gdjs {
841841
}
842842
const unscaledHeight = this._renderer.getUnscaledHeight();
843843
if (unscaledHeight !== 0) {
844-
this.setScaleY(newHeight / unscaledHeight);
844+
this.setScaleY(newHeight / (unscaledHeight * this._preScale));
845845
}
846846
}
847847

0 commit comments

Comments
 (0)