diff options
| author | Jabiertxof <jabier.arraiza@marker.es> | 2019-09-20 11:19:56 +0000 |
|---|---|---|
| committer | Jabiertxof <jabier.arraiza@marker.es> | 2019-09-28 15:36:46 +0000 |
| commit | 2dc01545cd0d0c860cbdf43d458731961e965c42 (patch) | |
| tree | 5bdba1337c0ccbbb540a96f9a7a1ff13ef4d34b2 /src | |
| parent | Fix LPE dialog style in info (diff) | |
| download | inkscape-2dc01545cd0d0c860cbdf43d458731961e965c42.tar.gz inkscape-2dc01545cd0d0c860cbdf43d458731961e965c42.zip | |
Fix issue pointed by Mc from https://twitter.com/geekeish/status/1174984172726673409
Diffstat (limited to 'src')
| -rw-r--r-- | src/live_effects/lpe-powerstroke.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/live_effects/lpe-powerstroke.cpp b/src/live_effects/lpe-powerstroke.cpp index fa961c9af..ef382d008 100644 --- a/src/live_effects/lpe-powerstroke.cpp +++ b/src/live_effects/lpe-powerstroke.cpp @@ -617,12 +617,15 @@ LPEPowerStroke::doEffect_path (Geom::PathVector const & path_in) Geom::Point start = Geom::Point( pwd2_in.domain().min(), ts.front()[Geom::Y]); Geom::Point end = Geom::Point( pwd2_in.domain().max(), ts.front()[Geom::Y]); if (ts.size() > 1) { - ts_close.push_back(ts[ts.size()-2]); - ts_close.push_back(ts.back()); - ts_close.push_back(ts.front()); - ts_close.push_back(ts[1]); + ts_close.push_back(ts[ts.size()-1]); + /* double big = std::max(ts[ts.size()-1][Geom::Y], ts[0][Geom::Y]); + double small = middle_point(ts[ts.size()-1][Geom::Y], ts[0][Geom::Y]); + int sign = big > 0 ? 1 : -1; */ + Geom::Point inbetween = Geom::Point((ts[ts.size()-1][Geom::X] + ts[0][Geom::X])/2.0, middle_point(ts[ts.size()-1], ts[0])[Geom::Y]); + ts_close.push_back(inbetween); + ts_close.push_back(ts[0]); Geom::Path closepath = interpolator->interpolateToPath(ts_close); - start = closepath.pointAt(Geom::nearest_time(Geom::Point( pwd2_in.domain().min(),0), closepath)); + start = closepath.pointAt(Geom::nearest_time(pathv[0].initialPoint(), closepath)); start[Geom::X] = pwd2_in.domain().min(); end = start; end[Geom::X] = pwd2_in.domain().max(); |
