Don't access edge_table->aabb if it hasn't been initialised yet; prevents a warning...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 2 Apr 2007 14:33:08 +0000 (14:33 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 2 Apr 2007 14:33:08 +0000 (14:33 +0000)
git-svn-id: http://svn.voria.com/code@417 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/layer_shape.cpp

index 7845d0a..c9af3f2 100644 (file)
@@ -711,6 +711,8 @@ struct CurveArray
 struct Layer_Shape::Intersector
 {
        Rect    aabb;
+
+       //! true iff aabb hasn't been initialised yet
        bool    initaabb;
 
        int     flags;
@@ -3066,9 +3068,12 @@ Layer_Shape::get_bounding_rect()const
        if(invert)
                return Rect::full_plane();
 
-       Rect bounds(edge_table->aabb+offset);
-       bounds.expand(max((bounds.get_min()-bounds.get_max()).mag()*0.01,feather));
+       if (edge_table->initaabb)
+               return Rect::zero();
 
+       Rect bounds(edge_table->aabb+offset);
+       bounds.expand(max((bounds.get_min() - bounds.get_max()).mag()*0.01,
+                                         feather));
 
        return bounds;
 }