summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64329c6)
raw | patch | inline | side by side (parent: 64329c6)
author | mental <mental@users.sourceforge.net> | |
Mon, 19 Mar 2007 00:08:37 +0000 (00:08 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Mon, 19 Mar 2007 00:08:37 +0000 (00:08 +0000) |
but I have no time to fix the code now
src/libnr/nr-rect.cpp | patch | blob | history | |
src/libnr/nr-rect.h | patch | blob | history |
diff --git a/src/libnr/nr-rect.cpp b/src/libnr/nr-rect.cpp
index 72bced37bb048ca9337d8c03658710f412c2dd81..70ab71850836d5b5941bcad5da75eccf08ecfdfb 100644 (file)
--- a/src/libnr/nr-rect.cpp
+++ b/src/libnr/nr-rect.cpp
_max(std::max(p0[X], p1[X]), std::max(p0[Y], p1[Y]))
{}
+Rect::Rect(NRRect *r)
+ : _min(r->x0, r->y0),
+ _max(r->x1, r->y1)
+{}
+
+Rect::Rect(NRRectL *r)
+ : _min(r->x0, r->y0),
+ _max(r->x1, r->y1)
+{}
+
/** returns the four corners of the rectangle in the correct winding order */
Point Rect::corner(unsigned i) const {
switch (i % 4) {
diff --git a/src/libnr/nr-rect.h b/src/libnr/nr-rect.h
index 04f446487cccbb3928ded725fc143ecf8cbc2a70..2439df95d3361dde016a240eb35f3e518fd0386e 100644 (file)
--- a/src/libnr/nr-rect.h
+++ b/src/libnr/nr-rect.h
#include <libnr/nr-maybe.h>
#include <libnr/nr-point-matrix-ops.h>
+struct NRRect;
+struct NRRectL;
+
namespace NR {
struct Matrix;
public:
Rect() : _min(-_inf(), -_inf()), _max(_inf(), _inf()) {}
Rect(Point const &p0, Point const &p1);
+ Rect(NRRect *r);
+ Rect(NRRectL *r);
Point const &min() const { return _min; }
Point const &max() const { return _max; }