From ffad504bec2b31828f6fe10edfab5ec8ef6437fb Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Tue, 11 Nov 2014 19:59:49 +0100 Subject: Code cleanup (bzr r13682.1.4) --- src/live_effects/lpe-mirror_symmetry.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp index 67f4e3f16..fa588fe96 100644 --- a/src/live_effects/lpe-mirror_symmetry.cpp +++ b/src/live_effects/lpe-mirror_symmetry.cpp @@ -107,12 +107,14 @@ LPEMirrorSymmetry::doEffect_path (std::vector const & path_in) Geom::Path mlineExpanded; Geom::Line lineSeparation; lineSeparation.setPoints(mline[0].initialPoint(),mline[0].finalPoint()); - mlineExpanded.start( lineSeparation.pointAt(-100000)); - mlineExpanded.appendNew( lineSeparation.pointAt(100000)); + Geom::Point lineStart = lineSeparation.pointAt(-100000.0); + Geom::Point lineEnd = lineSeparation.pointAt(100000.0); + mlineExpanded.start( lineStart); + mlineExpanded.appendNew( lineEnd); Geom::Crossings cs = crossings(*path_it, mlineExpanded); double timeStart = 0.0; //http://stackoverflow.com/questions/1560492/how-to-tell-whether-a-point-is-to-the-right-or-left-side-of-a-line - double pos = (lineSeparation.pointAt(100000)[Geom::X]-lineSeparation.pointAt(-100000)[Geom::X])*(path_it->initialPoint()[Geom::Y]-lineSeparation.pointAt(-100000)[Geom::Y]) - (lineSeparation.pointAt(100000)[Geom::Y]-lineSeparation.pointAt(-100000)[Geom::Y])*(path_it->initialPoint()[Geom::X]-lineSeparation.pointAt(-100000)[Geom::X]); + double pos = (lineEnd[Geom::X]-lineStart[Geom::X])*(path_it->initialPoint()[Geom::Y]-lineStart[Geom::Y]) - (lineEnd[Geom::Y]-lineStart[Geom::Y])*(path_it->initialPoint()[Geom::X]-lineStart[Geom::X]); int position = (pos < 0) ? -1 : (pos > 0); unsigned int counter = 0; -- cgit v1.2.3