Fix Item#setPosition and Item#setBounds to actually work (unfinished porting work).

This commit is contained in:
Jürg Lehni 2011-02-14 01:14:43 +00:00
parent 3af5d549f6
commit 50f285798c

View file

@ -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));
} }
}); });