Declare the paste_canvas pointing in the block that uses it to limit its scope.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 21 Jan 2008 17:02:42 +0000 (17:02 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Mon, 21 Jan 2008 17:02:42 +0000 (17:02 +0000)
git-svn-id: http://svn.voria.com/code@1413 1f10aa63-cdf2-0310-b900-c93c546f37ac

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

index e7a54f9..24760ab 100644 (file)
@@ -1082,12 +1082,12 @@ synfig::optimize_layers(Context context, Canvas::Handle op_canvas, bool seen_mot
                if(value.get_type()==ValueBase::TYPE_REAL && value.get(Real())==0)
                        continue;
 
-               Layer_PasteCanvas* paste_canvas(static_cast<Layer_PasteCanvas*>(layer.get()));
-
                // note: this used to include "&& paste_canvas->get_time_offset()==0", but then
                //               time-shifted layers weren't being sorted by z-depth (bug #1806852)
                if(layer->get_name()=="PasteCanvas")
                {
+                       Layer_PasteCanvas* paste_canvas(static_cast<Layer_PasteCanvas*>(layer.get()));
+
                        // we need to blur the sub canvas if:
                        // our parent is blurred,
                        // or the child is lower than a local blur,