diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2015-05-09 15:23:25 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2015-05-09 15:23:25 +0000 |
| commit | 6d9c35c80d9cabfe44682ecfa724bd0d517c56f4 (patch) | |
| tree | 777d318fe9153e0c24abef521f3c44af66234ab3 /src/2geom/path.cpp | |
| parent | Merge from trunk (diff) | |
| download | inkscape-6d9c35c80d9cabfe44682ecfa724bd0d517c56f4.tar.gz inkscape-6d9c35c80d9cabfe44682ecfa724bd0d517c56f4.zip | |
Fix eraser tool
(bzr r14059.2.12)
Diffstat (limited to 'src/2geom/path.cpp')
| -rw-r--r-- | src/2geom/path.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/2geom/path.cpp b/src/2geom/path.cpp index 71b7b25bb..e38835776 100644 --- a/src/2geom/path.cpp +++ b/src/2geom/path.cpp @@ -215,6 +215,18 @@ PathInterval PathInterval::from_direction(PathTime const &from, PathTime const & } +Path::Path(Rect const &r) + : _curves(new Sequence()) + , _closing_seg(new ClosingSegment(r.corner(3), r.corner(0))) + , _closed(true) + , _exception_on_stitch(true) +{ + for (unsigned i = 0; i < 3; ++i) { + _curves->push_back(new LineSegment(r.corner(i), r.corner(i+1))); + } + _curves->push_back(_closing_seg); +} + Path::Path(ConvexHull const &ch) : _curves(new Sequence()) , _closing_seg(new ClosingSegment(Point(), Point())) @@ -678,12 +690,12 @@ Path Path::reversed() const typedef std::reverse_iterator<Sequence::const_iterator> RIter; Path ret; - ret._curves->pop_back(); - RIter iter(_curves->end()), rend(_curves->begin()); + ret._curves->pop_back(); // this also deletes the closing segment + RIter iter(_curves->end() - 1), rend(_curves->begin()); for (; iter != rend; ++iter) { ret._curves->push_back(iter->reverse()); } - ret._closing_seg = static_cast<ClosingSegment *>(ret._closing_seg->reverse()); + ret._closing_seg = static_cast<ClosingSegment *>(_closing_seg->reverse()); ret._curves->push_back(ret._closing_seg); return ret; } |
