mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -05:00
Fencing - Take 3
Dependant on scratch-render pull request.
This commit is contained in:
parent
9aa81d6776
commit
75e3f6002b
1 changed files with 8 additions and 4 deletions
|
@ -167,16 +167,20 @@ RenderedTarget.prototype.setXY = function (x, y) {
|
|||
}
|
||||
var oldX = this.x;
|
||||
var oldY = this.y;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
if (this.renderer) {
|
||||
this.renderer.fencePositionOfDrawable(this.drawableID, this);
|
||||
var position = this.renderer.getFencedPositionOfDrawable(this.drawableID, [x, y]);
|
||||
this.x = position.x;
|
||||
this.y = position.y;
|
||||
|
||||
this.renderer.updateDrawableProperties(this.drawableID, {
|
||||
position: [this.x, this.y]
|
||||
position: position
|
||||
});
|
||||
if (this.visible) {
|
||||
this.runtime.requestRedraw();
|
||||
}
|
||||
} else {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
this.emit(RenderedTarget.EVENT_TARGET_MOVED, this, oldX, oldY);
|
||||
this.runtime.spriteInfoReport(this);
|
||||
|
|
Loading…
Reference in a new issue