summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 656cbf3)
raw | patch | inline | side by side (parent: 656cbf3)
author | mental <mental@users.sourceforge.net> | |
Sun, 4 Mar 2007 19:06:59 +0000 (19:06 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Sun, 4 Mar 2007 19:06:59 +0000 (19:06 +0000) |
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 c681783c7b6fd63d2de830e6a4f92c5dc693cb11..76d7fff8dd8ce956bc4f6b326d698a0992821253 100644 (file)
--- a/src/libnr/nr-rect.cpp
+++ b/src/libnr/nr-rect.cpp
}
}
-Maybe<Rect> Rect::union_bounds(Maybe<Rect> const &a, Maybe<Rect> const &b) {
- if (a) {
- return b;
- } else if (b) {
- return a;
- } else {
- return union_bounds(*a, *b);
- }
-}
-
/** returns the smallest rectangle containing both rectangles */
Rect Rect::union_bounds(Rect const &a, Rect const &b) {
Rect r;
diff --git a/src/libnr/nr-rect.h b/src/libnr/nr-rect.h
index b6918c4931b77e8730b3f4c33add4b79e6d8800d..115f94e46043f2bb36fd3485559c18187d6a8833 100644 (file)
--- a/src/libnr/nr-rect.h
+++ b/src/libnr/nr-rect.h
static Maybe<Rect> intersection(Maybe<Rect> const &a, Maybe<Rect> const &b);
/** Returns the smallest rectangle that encloses both rectangles. */
- static Maybe<Rect> union_bounds(Maybe<Rect> const &a, Maybe<Rect> const &b);
+ static Maybe<Rect> union_bounds(Maybe<Rect> const &a, Maybe<Rect> const &b)
+ {
+ if (!a) {
+ return b;
+ } else if (!b) {
+ return a;
+ } else {
+ return union_bounds(*a, *b);
+ }
+ }
+ static Rect union_bounds(Maybe<Rect> const &a, Rect const &b) {
+ if (a) {
+ return union_bounds(*a, b);
+ } else {
+ return b;
+ }
+ }
+ static Rect union_bounds(Rect const &a, Maybe<Rect> const &b) {
+ if (b) {
+ return union_bounds(a, *b);
+ } else {
+ return a;
+ }
+ }
static Rect union_bounds(Rect const &a, Rect const &b);
/** Scales the rect by s, with origin at 0, 0 */