From: dooglus Date: Fri, 7 Nov 2008 15:06:42 +0000 (+0000) Subject: Finding the distance along a bezier curve from point x to point x was failing with... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=bd4b3d17e246ddb8c76b8aa30367b26bddee3bc1;p=synfig.git Finding the distance along a bezier curve from point x to point x was failing with a division by zero. Fix by always returning 0 in that case. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2163 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/ETL/trunk/ETL/_bezier.h b/ETL/trunk/ETL/_bezier.h index 70dfe99..4851a98 100644 --- a/ETL/trunk/ETL/_bezier.h +++ b/ETL/trunk/ETL/_bezier.h @@ -577,6 +577,7 @@ public: distance_type find_distance(time_type r, time_type s, int steps=7)const { const time_type inc((s-r)/steps); + if (!inc) return 0; distance_type ret(0); value_type last(operator()(r));