From 9a8590ef3386b9bfccacbc914f6c2197a3ac0698 Mon Sep 17 00:00:00 2001 From: rodolforg Date: Sun, 26 Dec 2021 01:50:33 -0300 Subject: [PATCH] Fix distortions at the end of lines made with the drawing tool (#2471) fix #2448 fix #2460 --- synfig-studio/src/synfigapp/blineconvert.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/synfig-studio/src/synfigapp/blineconvert.cpp b/synfig-studio/src/synfigapp/blineconvert.cpp index e19d7797a4a..1fc7531e6fb 100644 --- a/synfig-studio/src/synfigapp/blineconvert.cpp +++ b/synfig-studio/src/synfigapp/blineconvert.cpp @@ -558,13 +558,14 @@ synfigapp::BLineConverter::operator()(std::list &blinepoint cum_dist.resize(point_cache.size()); this_dist.resize(point_cache.size()); Real d = 0; - for(unsigned int i = 0; i < point_cache.size() - 1;) + for(unsigned int i = 0; i < point_cache.size(); i++) { + p2=point_cache[i]; + d += (this_dist[i] = (p2-p1).mag()); cum_dist[i] = d; p1=p2; - p2=point_cache[++i]; } } //disteval = timer();