mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -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) {
|
setBounds: function(rect) {
|
||||||
var bounds = this.bounds;
|
var bounds = this.bounds;
|
||||||
rect = Rectangle.read(arguments);
|
rect = Rectangle.read(arguments);
|
||||||
|
if (!rect)
|
||||||
|
return;
|
||||||
var matrix = new Matrix();
|
var matrix = new Matrix();
|
||||||
// Read this from bottom to top:
|
// Read this from bottom to top:
|
||||||
// Translate to new center:
|
// Translate to new center:
|
||||||
|
@ -434,7 +436,10 @@ Item = Base.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
setPosition: function(point) {
|
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