From 693e6eb237a6c4fbc9a9d47a30fad10b74e2157b Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 24 Jul 2014 01:20:18 +0200 Subject: Fix bug on closed nodes in fillet-chamfer LPE (bzr r13341.1.96) --- src/live_effects/lpe-fillet-chamfer.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp index a24f5e60e..1c3dc645c 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -512,24 +512,27 @@ LPEFilletChamfer::doEffect_path(std::vector const &path_in) if (filletChamferData[counter][Y] == 0) { time_it1 = 0; } - time_it2 = modf(fillet_chamfer_values.to_time( - counter + 1, filletChamferData[counter + 1][X]), - &intpart); - if (curve_it2 == curve_endit) { + if (path_it->closed() && curve_it2 == curve_endit) { time_it2 = modf(fillet_chamfer_values.to_time( counter - counterCurves, filletChamferData[counter - counterCurves][X]), &intpart); + } else { + time_it2 = modf(fillet_chamfer_values.to_time( + counter + 1, filletChamferData[counter + 1][X]), + &intpart); } - double resultLenght = - it1_length + fillet_chamfer_values.to_len( - counter + 1, filletChamferData[counter + 1][X]); + double resultLenght = 0; time_it1_B = 1; if (path_it->closed() && curve_it2 == curve_endit) { resultLenght = it1_length + fillet_chamfer_values.to_len( counter - counterCurves, filletChamferData[counter - counterCurves][X]); + } else { + resultLenght = + it1_length + fillet_chamfer_values.to_len( + counter + 1, filletChamferData[counter + 1][X]); } if (resultLenght > 0 && time_it2 != 0) { time_it1_B = modf(fillet_chamfer_values.to_time(counter, -resultLenght), @@ -541,7 +544,12 @@ LPEFilletChamfer::doEffect_path(std::vector const &path_in) time_it1_B = gapHelper; } } - if (filletChamferData[counter + 1][Y] == 0) { + if (path_it->closed() && curve_it2 == curve_endit && + filletChamferData[counter - counterCurves][Y] == 0) { + time_it1_B = 1; + time_it2 = 0; + } else if (path_it->size() > counterCurves + 1 && + filletChamferData[counter + 1][Y] == 0) { time_it1_B = 1; time_it2 = 0; } -- cgit v1.2.3