Logo Search packages:      
Sourcecode: inkscape version File versions

Rect NR::union_bounds ( Rect const &  a,
Rect const &  b 
)

returns the smallest rectangle containing both rectangles

Returns the smallest rectangle that encloses both rectangles.

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

References NR::Rect::_max, and NR::Rect::_min.

                                                {
    Rect r;
    for ( int i=0 ; i < 2 ; i++ ) {
        r._min[i] = std::min(a._min[i], b._min[i]);
        r._max[i] = std::max(a._max[i], b._max[i]);
    }
    return r;
}


Generated by  Doxygen 1.6.0   Back to index