Fix 1823082: don't render layers under a 'stretch' layer with zero x or y amount.
[synfig.git] / synfig-core / trunk / src / modules / lyr_std / stretch.cpp
index a6f4def..c8b5090 100644 (file)
@@ -155,6 +155,13 @@ Layer_Stretch::get_transform()const
 bool
 Layer_Stretch::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
 {
+       if (amount[0] == 0 || amount[1] == 0)
+       {
+               surface->set_wh(renddesc.get_w(), renddesc.get_h());
+               surface->clear();
+               return true;
+       }
+
        RendDesc desc(renddesc);
        desc.clear_flags();
     // Adjust the top_left and bottom_right points