diff options
Diffstat (limited to 'tools/source/generic/gen.cxx')
-rw-r--r-- | tools/source/generic/gen.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 7c182818c460..7a275eea3088 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -37,6 +37,15 @@ OString Pair::toString() const return ss.str().c_str(); } +tools::Rectangle tools::Rectangle::Justify( const Point& rLT, const Point& rRB ) +{ + long nLeft = std::min(rLT.X(), rRB.X()); + long nTop = std::min(rLT.Y(), rRB.Y()); + long nRight = std::max(rLT.X(), rRB.X()); + long nBottom = std::max(rLT.Y(), rRB.Y()); + return Rectangle( nLeft, nTop, nRight, nBottom ); +} + void tools::Rectangle::SetSize( const Size& rSize ) { if ( rSize.Width() < 0 ) |