X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Flyr_std%2Fsphere_distort.cpp;h=9c0003e677e2c6141fbf216e8fb691f4fbca51db;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=40ee9c73c3f3975e52ce7f27efad7235991b1571;hpb=8ef042c40521681cea99944097c4f90a5ac6cf74;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 40ee9c7..9c0003e 100644 --- a/synfig-core/trunk/src/modules/lyr_std/sphere_distort.cpp +++ b/synfig-core/trunk/src/modules/lyr_std/sphere_distort.cpp @@ -1,12 +1,12 @@ /* === S Y N F I G ========================================================= */ /*! \file sphere_distort.cpp -** \brief Sphere Distort File +** \brief Implementation of the "Spherize" layer ** ** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley -** Copyright (c) 2007 Chris Moore +** Copyright (c) 2007, 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -81,8 +81,7 @@ SYNFIG_LAYER_SET_CVS_ID(Layer_SphereDistort,"$Id$"); /* === E N T R Y P O I N T ================================================= */ Layer_SphereDistort::Layer_SphereDistort() -:Layer_Composite(1.0,Color::BLEND_STRAIGHT), -center(0,0), +:center(0,0), radius(1), percent(1.0), type(TYPE_NORMAL), @@ -350,7 +349,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"); @@ -548,6 +554,10 @@ Rect Layer_SphereDistort::get_bounding_rect()const { Rect bounds(Rect::full_plane()); + + if (clip) + return bounds; + switch(type) { case TYPE_NORMAL: