mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Fix Item#setPosition and Item#setBounds to actually work (unfinished porting work).
This commit is contained in:
parent
3af5d549f6
commit
50f285798c
1 changed files with 4 additions and 4 deletions
|
@ -387,7 +387,7 @@ Item = Base.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
getBounds: function() {
|
getBounds: function() {
|
||||||
// TODO: Implement
|
// TODO: Implement for items other than paths
|
||||||
return new Rectangle();
|
return new Rectangle();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ Item = Base.extend({
|
||||||
center = bounds.center;
|
center = bounds.center;
|
||||||
matrix.translate(-center.x, -center.y);
|
matrix.translate(-center.x, -center.y);
|
||||||
// Now execute the transformation:
|
// Now execute the transformation:
|
||||||
transform(matrix);
|
this.transform(matrix);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -434,7 +434,7 @@ Item = Base.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition: function(point) {
|
setPosition: function(point) {
|
||||||
translate(point.subtract(this.position));
|
this.translate(point.subtract(this.position));
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -529,7 +529,7 @@ Item = Base.extend({
|
||||||
* @see Matrix#shear(double, double)
|
* @see Matrix#shear(double, double)
|
||||||
*/
|
*/
|
||||||
shear: function(shx, shy, center) {
|
shear: function(shx, shy, center) {
|
||||||
// TODO: Add support for center ack to Scriptographer too!
|
// TODO: Add support for center back to Scriptographer too!
|
||||||
this.transform(new Matrix().shear(shx, shy, center || this.position));
|
this.transform(new Matrix().shear(shx, shy, center || this.position));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue