mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -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');
|
||||
this.setSize(size);
|
||||
// Since x and y start from the top left of an image, add
|
||||
// half of its size:
|
||||
this.translate(getPoint(node, 'x', 'y').add(size.divide(2)));
|
||||
// half of its size. We also need to take the raster's matrix
|
||||
// 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;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue