diff options
| author | Niko Kiirala <niko@kiirala.com> | 2007-12-06 23:31:29 +0000 |
|---|---|---|
| committer | kiirala <kiirala@users.sourceforge.net> | 2007-12-06 23:31:29 +0000 |
| commit | a26ea5588adcd2033ad5d32bbb9fb470c9615c20 (patch) | |
| tree | 2db91ff41fc80c764dd0a9f43fd8aeddf58da8ad /src/libnr | |
| parent | remove my drama comment (diff) | |
| download | inkscape-a26ea5588adcd2033ad5d32bbb9fb470c9615c20.tar.gz inkscape-a26ea5588adcd2033ad5d32bbb9fb470c9615c20.zip | |
Fized crashes & odd behaviour when resizing, zooming and rotating feTurbulence
(bzr r4187)
Diffstat (limited to 'src/libnr')
| -rw-r--r-- | src/libnr/nr-point-l.h | 10 | ||||
| -rw-r--r-- | src/libnr/nr-rect-l.h | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/libnr/nr-point-l.h b/src/libnr/nr-point-l.h index 8ddfd5e6f..4ae1a8b82 100644 --- a/src/libnr/nr-point-l.h +++ b/src/libnr/nr-point-l.h @@ -73,7 +73,15 @@ public: } return *this; } - + + bool operator==(IPoint const &other) const { + return _pt[X] == other[X] && _pt[Y] == other[Y]; + } + + bool operator!=(IPoint const &other) const { + return _pt[X] != other[X] || _pt[Y] != other[Y]; + } + private: ICoord _pt[2]; }; diff --git a/src/libnr/nr-rect-l.h b/src/libnr/nr-rect-l.h index b84a8f0cb..18065d1d7 100644 --- a/src/libnr/nr-rect-l.h +++ b/src/libnr/nr-rect-l.h @@ -19,7 +19,7 @@ class IRect { public: IRect(const NRRectL& r) : _min(r.x0, r.y0), _max(r.x1, r.y1) {} IRect(const IRect& r) : _min(r._min), _max(r._max) {} - IRect(const IPoint &p0, const IPoint &p1); + IRect(const IPoint &p0, const IPoint &p1) : _min(p0), _max(p1) {} /** as not all Rects are representable by IRects this gives the smallest IRect that contains * r. */ @@ -84,6 +84,14 @@ public: /** Returns the smallest rectangle that encloses both rectangles. */ static IRect union_bounds(const IRect &a, const IRect &b); + bool operator==(const IRect &other) const { + return (min() == other.min()) && (max() == other.max()); + } + + bool operator!=(const IRect &other) const { + return (min() != other.min()) || (max() != other.max()); + } + private: IRect() {} |
