round drawable position

Scratch 2 rendered sprite position is at whole numbers, while its vm
position may be rational numbers.
This commit is contained in:
Michael "Z" Goddard
2018-08-24 18:19:19 -04:00
parent fa5e1df732
commit b901c1ac75

View File

@@ -190,8 +190,8 @@ class Drawable {
if ('position' in properties && (
this._position[0] !== properties.position[0] ||
this._position[1] !== properties.position[1])) {
this._position[0] = properties.position[0];
this._position[1] = properties.position[1];
this._position[0] = Math.round(properties.position[0]);
this._position[1] = Math.round(properties.position[1]);
dirty = true;
}
if ('direction' in properties && this._direction !== properties.direction) {