From: dooglus Date: Mon, 2 Apr 2007 14:33:08 +0000 (+0000) Subject: Don't access edge_table->aabb if it hasn't been initialised yet; prevents a warning... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=92397cbcf72385d082daccd6352379a65c12694f;p=synfig.git Don't access edge_table->aabb if it hasn't been initialised yet; prevents a warning from valgrind. Commented 'initaabb' member variable. Improved formatting a little. git-svn-id: http://svn.voria.com/code@417 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/layer_shape.cpp b/synfig-core/trunk/src/synfig/layer_shape.cpp index 7845d0a..c9af3f2 100644 --- a/synfig-core/trunk/src/synfig/layer_shape.cpp +++ b/synfig-core/trunk/src/synfig/layer_shape.cpp @@ -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; }