diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-06-12 15:27:07 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-06-12 15:27:07 +0000 |
| commit | e40990e3b9c391cdded31f28bb8f8d448fd1d361 (patch) | |
| tree | e82113bde74f32de02935b298418dd12c5f3d474 /src/live_effects/parameter/satellitesarray.cpp | |
| parent | update to trunk (diff) | |
| download | inkscape-e40990e3b9c391cdded31f28bb8f8d448fd1d361.tar.gz inkscape-e40990e3b9c391cdded31f28bb8f8d448fd1d361.zip | |
Handle both directions on knot reposition
(bzr r13645.1.154)
Diffstat (limited to 'src/live_effects/parameter/satellitesarray.cpp')
| -rw-r--r-- | src/live_effects/parameter/satellitesarray.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/live_effects/parameter/satellitesarray.cpp b/src/live_effects/parameter/satellitesarray.cpp index db7cf80c0..18e1bd4de 100644 --- a/src/live_effects/parameter/satellitesarray.cpp +++ b/src/live_effects/parameter/satellitesarray.cpp @@ -305,13 +305,18 @@ void FilletChamferKnotHolderEntity::knot_set(Geom::Point const &p, { return; } - if (is_mirror) { - size_t previous_index = curve_index - 1; - if(curve_index == 0 && pathv[path_index].closed()){ - previous_index = pathv[path_index].size() - 1; - } - Geom::Curve const &curve_in = pathv[path_index][previous_index]; - double mirror_time = Geom::nearest_time(s, curve_in); + size_t previous_index = curve_index - 1; + if(curve_index == 0 && pathv[path_index].closed()){ + previous_index = pathv[path_index].size() - 1; + } + Geom::Curve const &curve_in = pathv[path_index][previous_index]; + double mirror_time = Geom::nearest_time(s, curve_in); + Geom::Point mirror = curve_in.pointAt(mirror_time); + double normal_time = Geom::nearest_time(s, pathv[path_index][curve_index]); + Geom::Point normal = pathv[path_index][curve_index].pointAt(normal_time); + double distance_mirror = Geom::distance(mirror,s); + double distance_normal = Geom::distance(normal,s); + if (distance_mirror <= distance_normal) { double time_start = 0; Satellites satellites = _pparam->_last_pathvector_satellites->getSatellites(); time_start = satellites[path_index][previous_index].time(curve_in); |
