/* === S Y N F I G ========================================================= */
/*! \file stretch.cpp
-** \brief Template Header
+** \brief Implementation of the "Stretch" layer
**
** $Id$
**
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$");
ret.push_back(ParamDesc("amount")
.set_local_name(_("Amount"))
+ .set_origin("center")
);
ret.push_back(ParamDesc("center")
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