X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fmodules%2Flyr_std%2Fwarp.cpp;h=f11c290ae069e64a5f92bef19163f433a4946c9a;hb=756c0d29ac1742f231e6615f9a577e574e35a4af;hp=b89a1c586211eae7e46a46a5cc67863af8b2435e;hpb=8ef042c40521681cea99944097c4f90a5ac6cf74;p=synfig.git diff --git a/synfig-core/trunk/src/modules/lyr_std/warp.cpp b/synfig-core/trunk/src/modules/lyr_std/warp.cpp index b89a1c5..f11c290 100644 --- a/synfig-core/trunk/src/modules/lyr_std/warp.cpp +++ b/synfig-core/trunk/src/modules/lyr_std/warp.cpp @@ -1,12 +1,12 @@ /* === S Y N F I G ========================================================= */ /*! \file warp.cpp -** \brief Template File +** \brief Implementation of the "Warp" 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 @@ -614,16 +614,12 @@ Warp::accelerated_render(Context context,Surface *surface,int quality, const Ren Point min_point(bounding_rect.get_min()); Point max_point(bounding_rect.get_max()); - // we're going to divide by the different of these pairs soon; + // we're going to divide by the difference of these pairs soon; // if they're the same, we'll be dividing by zero, and we don't // want to do that! // \todo what should we do in this case? - if (min_point[0] == max_point[0] || min_point[1] == max_point[1]) - { - surface->set_wh(renddesc.get_w(),renddesc.get_h()); - surface->clear(); - return true; - } + if (min_point[0] == max_point[0]) max_point[0] += 0.001; + if (min_point[1] == max_point[1]) max_point[1] += 0.001; if(tl[0]>br[0]) { @@ -710,7 +706,7 @@ Warp::accelerated_render(Context context,Surface *surface,int quality, const Ren else (*surface)[y][x]=source.cubic_sample(u,v); } - if(y&31==0 && cb) + if((y&31)==0 && cb) { if(!stagetwo.amount_complete(y,surface->get_h())) return false; @@ -744,7 +740,7 @@ Warp::accelerated_render(Context context,Surface *surface,int quality, const Ren else (*surface)[y][x]=source.linear_sample(u,v); } - if(y&31==0 && cb) + if((y&31)==0 && cb) { if(!stagetwo.amount_complete(y,surface->get_h())) return false; @@ -778,7 +774,7 @@ Warp::accelerated_render(Context context,Surface *surface,int quality, const Ren //pen.set_value(source[v][u]); (*surface)[y][x]=source[floor_to_int(v)][floor_to_int(u)]; } - if(y&31==0 && cb) + if((y&31)==0 && cb) { if(!stagetwo.amount_complete(y,surface->get_h())) return false;