diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2014-11-11 18:59:49 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2014-11-11 18:59:49 +0000 |
| commit | ffad504bec2b31828f6fe10edfab5ec8ef6437fb (patch) | |
| tree | caa0b93f55c54515b637da25c0bc372c4a7f2c03 /src | |
| parent | added join mode (diff) | |
| download | inkscape-ffad504bec2b31828f6fe10edfab5ec8ef6437fb.tar.gz inkscape-ffad504bec2b31828f6fe10edfab5ec8ef6437fb.zip | |
Code cleanup
(bzr r13682.1.4)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-mirror_symmetry.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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<Geom::Path> const & path_in) Geom::Path mlineExpanded; Geom::Line lineSeparation; lineSeparation.setPoints(mline[0].initialPoint(),mline[0].finalPoint()); - mlineExpanded.start( lineSeparation.pointAt(-100000)); - mlineExpanded.appendNew<Geom::LineSegment>( lineSeparation.pointAt(100000)); + Geom::Point lineStart = lineSeparation.pointAt(-100000.0); + Geom::Point lineEnd = lineSeparation.pointAt(100000.0); + mlineExpanded.start( lineStart); + mlineExpanded.appendNew<Geom::LineSegment>( 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; |
