mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-08 05:42:07 -05:00
parent
0440adb575
commit
3a10974612
1 changed files with 6 additions and 2 deletions
|
@ -209,8 +209,12 @@ new function() {
|
||||||
var size = getSize(node, 'width', 'height');
|
var size = getSize(node, 'width', 'height');
|
||||||
this.setSize(size);
|
this.setSize(size);
|
||||||
// Since x and y start from the top left of an image, add
|
// Since x and y start from the top left of an image, add
|
||||||
// half of its size:
|
// half of its size. We also need to take the raster's matrix
|
||||||
this.translate(getPoint(node, 'x', 'y').add(size.divide(2)));
|
// into account, which will be defined by the time the load
|
||||||
|
// event is called.
|
||||||
|
var center = this._matrix._transformPoint(
|
||||||
|
getPoint(node, 'x', 'y').add(size.divide(2)));
|
||||||
|
this.translate(center);
|
||||||
});
|
});
|
||||||
return raster;
|
return raster;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue