mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Have Item#setPosition use Point.read() for point conversion.
This commit is contained in:
parent
50f285798c
commit
87f146fb44
1 changed files with 6 additions and 1 deletions
|
@ -394,6 +394,8 @@ Item = Base.extend({
|
|||
setBounds: function(rect) {
|
||||
var bounds = this.bounds;
|
||||
rect = Rectangle.read(arguments);
|
||||
if (!rect)
|
||||
return;
|
||||
var matrix = new Matrix();
|
||||
// Read this from bottom to top:
|
||||
// Translate to new center:
|
||||
|
@ -434,7 +436,10 @@ Item = Base.extend({
|
|||
},
|
||||
|
||||
setPosition: function(point) {
|
||||
this.translate(point.subtract(this.position));
|
||||
point = Point.read(arguments);
|
||||
if (point) {
|
||||
this.translate(point.subtract(this.position));
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue