summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2000535)
raw | patch | inline | side by side (parent: 2000535)
author | mental <mental@users.sourceforge.net> | |
Sun, 4 Mar 2007 19:06:52 +0000 (19:06 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Sun, 4 Mar 2007 19:06:52 +0000 (19:06 +0000) |
src/libnr/nr-rect.cpp | patch | blob | history |
diff --git a/src/libnr/nr-rect.cpp b/src/libnr/nr-rect.cpp
index c3d23a6198e251db90aa3bc0510d5bf9d8ad8b9d..c681783c7b6fd63d2de830e6a4f92c5dc693cb11 100644 (file)
--- a/src/libnr/nr-rect.cpp
+++ b/src/libnr/nr-rect.cpp
/** Returns the set of points shared by both rectangles. */
Maybe<Rect> Rect::intersection(Maybe<Rect> const &a, Maybe<Rect> const &b) {
- if ( a == Nothing() || b == Nothing() ) {
+ if ( !a || !b ) {
return Nothing();
} else {
- Rect const &ra=a.assume();
- Rect const &rb=b.assume();
Rect r;
for ( int i=0 ; i < 2 ; i++ ) {
- r._min[i] = MAX(ra._min[i], rb._min[i]);
- r._max[i] = MIN(ra._max[i], rb._max[i]);
+ r._min[i] = MAX(a->_min[i], b->_min[i]);
+ r._max[i] = MIN(a->_max[i], b->_max[i]);
if ( r._min[i] > r._max[i] ) {
return Nothing();
}