diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2011-07-09 00:52:06 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2011-07-09 00:52:06 +0000 |
| commit | a3e406b2ceafb8fb6b44db0a7816a083d7b3c8ee (patch) | |
| tree | 7e9a749edf47feed38908b5dad896f79f791c4e2 /src/libnr/nr-rect-l.cpp | |
| parent | Merge from trunk (diff) | |
| download | inkscape-a3e406b2ceafb8fb6b44db0a7816a083d7b3c8ee.tar.gz inkscape-a3e406b2ceafb8fb6b44db0a7816a083d7b3c8ee.zip | |
Add SPCanvasArena caching layer. Currently breaks for clipped groups
that contain filtered objects (Cairo clipping bug?)
(bzr r10347.1.6)
Diffstat (limited to 'src/libnr/nr-rect-l.cpp')
| -rw-r--r-- | src/libnr/nr-rect-l.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/libnr/nr-rect-l.cpp b/src/libnr/nr-rect-l.cpp index 08910a1d6..1cb268266 100644 --- a/src/libnr/nr-rect-l.cpp +++ b/src/libnr/nr-rect-l.cpp @@ -1,3 +1,52 @@ +#include "libnr/nr-rect-l.h" + +NRRectL::NRRectL() +{ + x0 = G_MAXINT32; + y0 = G_MAXINT32; + x1 = G_MININT32; + y1 = G_MININT32; +} + +NRRectL::NRRectL(gint32 xmin, gint32 ymin, gint32 xmax, gint32 ymax) +{ + x0 = xmin; + y0 = ymin; + x1 = xmax; + y1 = ymax; +} + +NRRectL::NRRectL(Geom::OptIntRect const &r) +{ + if (r) { + x0 = r->left(); + y0 = r->top(); + x1 = r->right(); + y1 = r->bottom(); + } else { + x0 = G_MAXINT32; + y0 = G_MAXINT32; + x1 = G_MININT32; + y1 = G_MININT32; + } +} + +NRRectL::NRRectL(Geom::IntRect const &r) +{ + x0 = r.left(); + y0 = r.top(); + x1 = r.right(); + y1 = r.bottom(); +} + +Geom::OptIntRect NRRectL::upgrade_2geom() const +{ + Geom::OptIntRect ret; + if (x0 > x1 || y0 > y1) return ret; + ret = Geom::IntRect(x0, y0, x1, y1); + return ret; +} + /* Local Variables: mode:c++ |
