X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Flyr_std%2Fstretch.cpp;h=de0de940c6ffdec4a4877a3338cf8dd4c47eb81b;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=a6f4deff94fc7e6ee88b75342bb4b9c0dc628de3;hpb=7b4762d8b568f70e9b1a8d18afe0998af661d906;p=synfig.git diff --git a/synfig-core/trunk/src/modules/lyr_std/stretch.cpp b/synfig-core/trunk/src/modules/lyr_std/stretch.cpp index a6f4def..de0de94 100644 --- a/synfig-core/trunk/src/modules/lyr_std/stretch.cpp +++ b/synfig-core/trunk/src/modules/lyr_std/stretch.cpp @@ -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