Fix 2152666: Animation of Rotate Layer produces jitter.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 11 Oct 2008 07:00:30 +0000 (07:00 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sat, 11 Oct 2008 07:00:30 +0000 (07:00 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2093 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/modules/lyr_std/rotate.cpp

index 39dcbf4..fd13f92 100644 (file)
@@ -228,6 +228,11 @@ Rotate::accelerated_render(Context context,Surface *surface,int quality, const R
        Real pw=(renddesc.get_w())/(renddesc.get_br()[0]-renddesc.get_tl()[0]);
        Real ph=(renddesc.get_h())/(renddesc.get_br()[1]-renddesc.get_tl()[1]);
 
+       // we're going to round the canvas size to an integer number of pixels, so round the
+       // tl-br rectangle accordingly - otherwise we see the jittering described in bug 2152666
+       br[0] -= (pw*(br[0]-tl[0]) - round_to_int(pw*(br[0]-tl[0]))) / pw;
+       br[1] -= (ph*(br[1]-tl[1]) - round_to_int(ph*(br[1]-tl[1]))) / ph;
+
        RendDesc desc(renddesc);
        desc.clear_flags();
        //desc.set_flags(RendDesc::PX_ASPECT);