1
0
Fork 0

Canvas: Bounding box may not exist

This commit is contained in:
Thomas Geymayer 2012-09-25 22:20:39 +02:00
parent a8165a82e8
commit 5650e97397

View file

@ -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()