mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-28 22:30:40 -04:00
Merge pull request #459 from griffpatch/feature/FencingAgain
Feature fencing again
This commit is contained in:
commit
370f2c6a47
1 changed files with 8 additions and 3 deletions
|
@ -167,15 +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) {
|
||||
var position = this.renderer.getFencedPositionOfDrawable(this.drawableID, [x, y]);
|
||||
this.x = position[0];
|
||||
this.y = position[1];
|
||||
|
||||
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…
Add table
Add a link
Reference in a new issue