Logo Search packages:      
Sourcecode: inkscape version File versions

Maybe< Rect > NR::Rect::intersection ( const Rect a,
const Rect b 
) [static]

Returns the set of points shared by both rectangles.

Definition at line 200 of file nr-rect.cpp.

References _max, and _min.

                                                           {
      Rect r;
      for ( int i=0 ; i < 2 ; 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();
            }
      }
      return r;
}


Generated by  Doxygen 1.6.0   Back to index