From: dooglus Date: Thu, 1 Nov 2007 01:48:18 +0000 (+0000) Subject: Fix a crash in the draw tool. The resulting bline should approximate the drawn curve... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=493f4126a799967d1ab9381aaf07d1d5915712e4;p=synfig.git Fix a crash in the draw tool. The resulting bline should approximate the drawn curve more accurately now. git-svn-id: http://svn.voria.com/code@1093 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/synfigapp/blineconvert.cpp b/synfig-studio/trunk/src/synfigapp/blineconvert.cpp index cc01ce9..b3942cf 100644 --- a/synfig-studio/trunk/src/synfigapp/blineconvert.cpp +++ b/synfig-studio/trunk/src/synfigapp/blineconvert.cpp @@ -361,8 +361,12 @@ int tessellate_curves(const std::vector &inds, const std::vector //build hermite curve, it's easier curve.p1() = f[i0]; curve.p2() = f[i3]; - curve.t1() = df[i0]*(df[i0].mag_squared() > 1e-4 ? j2->tangentscale/df[i0].mag() : j2->tangentscale); - curve.t2() = df[i3]*(df[i3].mag_squared() > 1e-4 ? j->tangentscale/df[i3].mag() : j->tangentscale); + curve.t1() = df[i0-ibase] * (df[i0-ibase].mag_squared() > 1e-4 + ? j2->tangentscale/df[i0-ibase].mag() + : j2->tangentscale); + curve.t2() = df[i3-ibase] * (df[i3-ibase].mag_squared() > 1e-4 + ? j->tangentscale/df[i3-ibase].mag() + : j->tangentscale); curve.sync(); //MUST include the end point (since we are ignoring left one)