From ab143333746e25648b253f13c0539adff089b1b6 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Fri, 24 Jun 2011 00:22:07 +0200 Subject: Remove more of libnr (bzr r10347.1.2) --- src/libnr/nr-rect-l.cpp | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'src/libnr/nr-rect-l.cpp') diff --git a/src/libnr/nr-rect-l.cpp b/src/libnr/nr-rect-l.cpp index 9d1f80988..08910a1d6 100644 --- a/src/libnr/nr-rect-l.cpp +++ b/src/libnr/nr-rect-l.cpp @@ -1,23 +1,3 @@ -#include - -boost::optional NRRectL::upgrade() const { - if (nr_rect_l_test_empty_ptr(this)) { - return boost::optional(); - } else { - return NR::Rect(NR::Point(x0, y0), NR::Point(x1, y1)); - } -} - -namespace NR { - -IRect::IRect(Rect const &r) : - _min(int(floor(r.min()[X])), int(floor(r.min()[Y]))), - _max(int(ceil(r.min()[X])), int(ceil(r.min()[Y]))) -{ -} - -} - /* Local Variables: mode:c++ -- cgit v1.2.3 From a3e406b2ceafb8fb6b44db0a7816a083d7b3c8ee Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 9 Jul 2011 02:52:06 +0200 Subject: Add SPCanvasArena caching layer. Currently breaks for clipped groups that contain filtered objects (Cairo clipping bug?) (bzr r10347.1.6) --- src/libnr/nr-rect-l.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'src/libnr/nr-rect-l.cpp') 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++ -- cgit v1.2.3