diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2015-07-04 15:25:59 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2015-07-04 15:25:59 +0000 |
| commit | 60437ac397d41678daba5daece227240e8ddd364 (patch) | |
| tree | 31f18c8296ffde9122492b46623375fc98585b17 /src/2geom/path.cpp | |
| parent | 2Geom CMake adjustment (diff) | |
| download | inkscape-60437ac397d41678daba5daece227240e8ddd364.tar.gz inkscape-60437ac397d41678daba5daece227240e8ddd364.zip | |
Upgrade to 2Geom r2413
(bzr r14059.2.18)
Diffstat (limited to 'src/2geom/path.cpp')
| -rw-r--r-- | src/2geom/path.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp index 5fbc65b3e..836e65013 100644 --- a/src/2geom/path.cpp +++ b/src/2geom/path.cpp @@ -380,20 +380,6 @@ bool Path::operator==(Path const &other) const return *_curves == *other._curves; } -Path &Path::operator*=(Affine const &m) -{ - _unshare(); - Sequence::iterator last = _curves->end() - 1; - Sequence::iterator it; - - for (it = _curves->begin(); it != last; ++it) { - it->transform(m); - } - _closing_seg->transform(m); - checkContinuity(); - return *this; -} - void Path::start(Point const &p) { if (_curves->size() > 1) { clear(); @@ -507,7 +493,7 @@ protected: int ib = i->bound.index; if (which == 0) { - cx = record.item->intersect(*i->item); + cx = record.item->intersect(*i->item, _precision); } else { cx = i->item->intersect(*record.item, _precision); std::swap(ia, ib); @@ -535,7 +521,14 @@ std::vector<PathIntersection> Path::intersect(Path const &other, Coord precision CurveSweeper sweeper(*this, other, result, precision); sweeper.process(); - // TODO: remove multiple intersections within precision of each other? + // preprocessing to remove duplicate intersections at endpoints + for (std::size_t i = 0; i < result.size(); ++i) { + result[i].first.normalizeForward(size()); + result[i].second.normalizeForward(other.size()); + } + std::sort(result.begin(), result.end()); + result.erase(std::unique(result.begin(), result.end()), result.end()); + return result; } |
