From 92397cbcf72385d082daccd6352379a65c12694f Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 2 Apr 2007 14:33:08 +0000 Subject: [PATCH] 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 --- synfig-core/trunk/src/synfig/layer_shape.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; } -- 2.7.4