Canvas: Bounding box may not exist
This commit is contained in:
parent
a8165a82e8
commit
5650e97397
1 changed files with 12 additions and 9 deletions
|
@ -266,15 +266,18 @@ var Element = {
|
|||
getBoundingBox: func()
|
||||
{
|
||||
var bb = me._node.getNode("bounding-box");
|
||||
var min_x = bb.getNode("min-x").getValue();
|
||||
|
||||
if( min_x != nil )
|
||||
return [ min_x,
|
||||
bb.getNode("min-y").getValue(),
|
||||
bb.getNode("max-x").getValue(),
|
||||
bb.getNode("max-y").getValue() ];
|
||||
else
|
||||
return [0, 0, 0, 0];
|
||||
if( bb != nil )
|
||||
{
|
||||
var min_x = bb.getNode("min-x").getValue();
|
||||
|
||||
if( min_x != nil )
|
||||
return [ min_x,
|
||||
bb.getNode("min-y").getValue(),
|
||||
bb.getNode("max-x").getValue(),
|
||||
bb.getNode("max-y").getValue() ];
|
||||
}
|
||||
|
||||
return [0, 0, 0, 0];
|
||||
},
|
||||
# Set transformation center (currently only used for rotation)
|
||||
setCenter: func()
|
||||
|
|
Loading…
Reference in a new issue