Remove .gitignore do nothing is ignored.
[synfig.git] / synfig-core / trunk / src / modules / lyr_std / stretch.cpp
index a6f4def..de0de94 100644 (file)
@@ -1,6 +1,6 @@
 /* === S Y N F I G ========================================================= */
 /*!    \file stretch.cpp
-**     \brief Template Header
+**     \brief Implementation of the "Stretch" layer
 **
 **     $Id$
 **
@@ -55,8 +55,8 @@ using namespace synfig;
 
 SYNFIG_LAYER_INIT(Layer_Stretch);
 SYNFIG_LAYER_SET_NAME(Layer_Stretch,"stretch");
-SYNFIG_LAYER_SET_LOCAL_NAME(Layer_Stretch,_("Stretch"));
-SYNFIG_LAYER_SET_CATEGORY(Layer_Stretch,_("Distortions"));
+SYNFIG_LAYER_SET_LOCAL_NAME(Layer_Stretch,N_("Stretch"));
+SYNFIG_LAYER_SET_CATEGORY(Layer_Stretch,N_("Distortions"));
 SYNFIG_LAYER_SET_VERSION(Layer_Stretch,"0.1");
 SYNFIG_LAYER_SET_CVS_ID(Layer_Stretch,"$Id$");
 
@@ -101,6 +101,7 @@ Layer_Stretch::get_param_vocab()const
 
        ret.push_back(ParamDesc("amount")
                .set_local_name(_("Amount"))
+               .set_origin("center")
        );
 
        ret.push_back(ParamDesc("center")
@@ -155,6 +156,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