mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
Merge pull request #1497 from amazinigmech2418/revert-1453-round-setxy
Revert "round x and y like Scratch 2 does"
This commit is contained in:
commit
4f18cdd4ee
1 changed files with 4 additions and 4 deletions
|
@ -272,8 +272,8 @@ class RenderedTarget extends Target {
|
||||||
const oldY = this.y;
|
const oldY = this.y;
|
||||||
if (this.renderer) {
|
if (this.renderer) {
|
||||||
const position = this.renderer.getFencedPositionOfDrawable(this.drawableID, [x, y]);
|
const position = this.renderer.getFencedPositionOfDrawable(this.drawableID, [x, y]);
|
||||||
position[0] = Math.round(position[0]);
|
position[0] = this._roundCoord(position[0], 8);
|
||||||
position[1] = Math.round(position[1]);
|
position[1] = this._roundCoord(position[1], 8);
|
||||||
this.x = position[0];
|
this.x = position[0];
|
||||||
this.y = position[1];
|
this.y = position[1];
|
||||||
|
|
||||||
|
@ -285,8 +285,8 @@ class RenderedTarget extends Target {
|
||||||
this.runtime.requestRedraw();
|
this.runtime.requestRedraw();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.x = Math.round(x);
|
this.x = this._roundCoord(x, 8);
|
||||||
this.y = Math.round(y);
|
this.y = this._roundCoord(y, 8);
|
||||||
}
|
}
|
||||||
this.emit(RenderedTarget.EVENT_TARGET_MOVED, this, oldX, oldY, force);
|
this.emit(RenderedTarget.EVENT_TARGET_MOVED, this, oldX, oldY, force);
|
||||||
this.runtime.requestTargetsUpdate(this);
|
this.runtime.requestTargetsUpdate(this);
|
||||||
|
|
Loading…
Reference in a new issue