diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-09-24 07:51:04 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-09-24 07:51:04 +0000 |
| commit | c1a2006fd8f82aace5415027f6d94e137d990875 (patch) | |
| tree | 583f3405a8411c1bc124cd36d83a47e052130b3c /src | |
| parent | Fix bug pointed in inkscape devel by Miguel Lopez and CR. Caution now rotate ... (diff) | |
| download | inkscape-c1a2006fd8f82aace5415027f6d94e137d990875.tar.gz inkscape-c1a2006fd8f82aace5415027f6d94e137d990875.zip | |
Code improvements on mirror symmetry
(bzr r15125)
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-mirror_symmetry.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp index 69bfaab9a..a9fb36626 100644 --- a/src/live_effects/lpe-mirror_symmetry.cpp +++ b/src/live_effects/lpe-mirror_symmetry.cpp @@ -178,13 +178,13 @@ LPEMirrorSymmetry::doEffect_path (Geom::PathVector const & path_in) Geom::Translate m1(point_a[0], point_a[1]); double hyp = Geom::distance(point_a, point_b); - if (hyp == 0) { - hyp = 0.000001; + double cos = 0; + double sen = 0; + if (hyp > 0) { + cos = (point_b[0] - point_a[0]) / hyp; + sen = (point_b[1] - point_a[1]) / hyp; } - double c = (point_b[0] - point_a[0]) / hyp; // cos(alpha) - double s = (point_b[1] - point_a[1]) / hyp; // sin(alpha) - - Geom::Affine m2(c, -s, s, c, 0.0, 0.0); + Geom::Affine m2(cos, -sen, sen, cos, 0.0, 0.0); Geom::Scale sca(1.0, -1.0); Geom::Affine m = m1.inverse() * m2; |
