From: mental Date: Sun, 4 Mar 2007 19:06:59 +0000 (+0000) Subject: return plain rect for union in all situations where a plain rect is given X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=50b21b29fcfca7cc52aa9b53552abc6376b1cc07;p=inkscape.git return plain rect for union in all situations where a plain rect is given --- diff --git a/src/libnr/nr-rect.cpp b/src/libnr/nr-rect.cpp index c681783c7..76d7fff8d 100644 --- a/src/libnr/nr-rect.cpp +++ b/src/libnr/nr-rect.cpp @@ -276,16 +276,6 @@ Maybe Rect::intersection(Maybe const &a, Maybe const &b) { } } -Maybe Rect::union_bounds(Maybe const &a, Maybe 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 b6918c493..115f94e46 100644 --- a/src/libnr/nr-rect.h +++ b/src/libnr/nr-rect.h @@ -184,7 +184,30 @@ public: static Maybe intersection(Maybe const &a, Maybe const &b); /** Returns the smallest rectangle that encloses both rectangles. */ - static Maybe union_bounds(Maybe const &a, Maybe const &b); + static Maybe union_bounds(Maybe const &a, Maybe const &b) + { + if (!a) { + return b; + } else if (!b) { + return a; + } else { + return union_bounds(*a, *b); + } + } + static Rect union_bounds(Maybe const &a, Rect const &b) { + if (a) { + return union_bounds(*a, b); + } else { + return b; + } + } + static Rect union_bounds(Rect const &a, Maybe 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 */