X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Flyr_std%2Fsphere_distort.cpp;h=d66262be46111f61e6ae32801eecefa1b2fb0631;hb=e3f4437fedbdd74aebbf1675723978853dac8a8b;hp=d44b753cf01426d810157f57d272dddfebb77228;hpb=37600b4b217caa5e316984ec0b035c5e8f9698af;p=synfig.git diff --git a/synfig-core/trunk/src/modules/lyr_std/sphere_distort.cpp b/synfig-core/trunk/src/modules/lyr_std/sphere_distort.cpp index d44b753..d66262b 100644 --- a/synfig-core/trunk/src/modules/lyr_std/sphere_distort.cpp +++ b/synfig-core/trunk/src/modules/lyr_std/sphere_distort.cpp @@ -1,6 +1,6 @@ /* === S Y N F I G ========================================================= */ /*! \file sphere_distort.cpp -** \brief Sphere Distort File +** \brief Implementation of the "Spherize" layer ** ** $Id$ ** @@ -69,8 +69,8 @@ enum SYNFIG_LAYER_INIT(Layer_SphereDistort); SYNFIG_LAYER_SET_NAME(Layer_SphereDistort,"spherize"); -SYNFIG_LAYER_SET_LOCAL_NAME(Layer_SphereDistort,_("Spherize")); -SYNFIG_LAYER_SET_CATEGORY(Layer_SphereDistort,_("Distortions")); +SYNFIG_LAYER_SET_LOCAL_NAME(Layer_SphereDistort,N_("Spherize")); +SYNFIG_LAYER_SET_CATEGORY(Layer_SphereDistort,N_("Distortions")); SYNFIG_LAYER_SET_VERSION(Layer_SphereDistort,"0.2"); SYNFIG_LAYER_SET_CVS_ID(Layer_SphereDistort,"$Id$"); @@ -350,7 +350,14 @@ bool Layer_SphereDistort::accelerated_render(Context context,Surface *surface,in (type == TYPE_DISTV && (sphr.miny >= windr.maxy || windr.miny >= sphr.maxy)) ) { //synfig::warning("Spherize: Bounding box reject"); - return context.accelerated_render(surface,quality,renddesc,cb); + if (clip) + { + surface->set_wh(renddesc.get_w(), renddesc.get_h()); + surface->clear(); + return true; + } + else + return context.accelerated_render(surface,quality,renddesc,cb); } //synfig::warning("Spherize: Bounding box accept"); @@ -396,7 +403,7 @@ bool Layer_SphereDistort::accelerated_render(Context context,Surface *surface,in close = origin[i] + v[i]*t; - //now get transforms and expand the rectangle to accomodate + //now get transforms and expand the rectangle to accommodate Point p = sphtrans(close,center,radius,percent,type); expandr.expand(p[0],p[1]); p = sphtrans(origin[i],center,radius,percent,type); @@ -408,7 +415,7 @@ bool Layer_SphereDistort::accelerated_render(Context context,Surface *surface,in /*synfig::warning("Spherize: Bounding box (%f,%f)-(%f,%f)", expandr.minx,expandr.miny,expandr.maxx,expandr.maxy);*/ - //now that we have the bouding rectangle of ALL the pixels (should be...) + //now that we have the bounding rectangle of ALL the pixels (should be...) //order it so that it's in the same orientation as the tl,br pair //synfig::warning("Spherize: Organize like tl,br"); @@ -548,6 +555,10 @@ Rect Layer_SphereDistort::get_bounding_rect()const { Rect bounds(Rect::full_plane()); + + if (clip) + return bounds; + switch(type) { case TYPE_NORMAL: