diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/libnr/nr-rect-l.cpp | 8 | ||||
| -rw-r--r-- | src/libnr/nr-rect-l.h | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/libnr/nr-rect-l.cpp b/src/libnr/nr-rect-l.cpp index 40db67a1e..3b00acd03 100644 --- a/src/libnr/nr-rect-l.cpp +++ b/src/libnr/nr-rect-l.cpp @@ -1,5 +1,13 @@ #include <libnr/nr-rect-l.h> +NR::Maybe<NR::Rect> NRRectL::upgrade() const { + if (nr_rect_l_test_empty(this)) { + return NR::Nothing(); + } else { + return NR::Rect(NR::Point(x0, y0), NR::Point(x1, y1)); + } +} + namespace NR { IRect::IRect(Rect const &r) : diff --git a/src/libnr/nr-rect-l.h b/src/libnr/nr-rect-l.h index 756a537b0..b84a8f0cb 100644 --- a/src/libnr/nr-rect-l.h +++ b/src/libnr/nr-rect-l.h @@ -2,13 +2,15 @@ #define SEEN_NR_RECT_L_H #include <libnr/nr-i-coord.h> +#include <libnr/nr-maybe.h> +#include <libnr/nr-rect.h> +#include <libnr/nr-point-l.h> struct NRRectL { + NR::Maybe<NR::Rect> upgrade() const; NR::ICoord x0, y0, x1, y1; }; -#include <libnr/nr-rect.h> -#include <libnr/nr-point-l.h> namespace NR { |
