diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2022-07-23 23:48:24 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-08-24 10:55:15 +0200 |
commit | 59210b075b79e4fc58f86542d9947d6ed0073abd (patch) | |
tree | af9f6c1a8d5de2d2ccde0e8671f9b320775a5f98 /tools/source | |
parent | 51d2e734099e5c5c56393ef9f08007a7df441794 (diff) |
tools: rename Rectangle::Justify() to Rectangle::Normalize()
Jusify() normalizes the rectangle so both the Width and Height are
positive, without changing the location of the rectangle. It ensures
that the x and y coordinates will be moved to the top left of the
rectangle.
The name is strange, so renaming Justify() to Normalize().
Change-Id: Idbf163e65e52a798e38f785b8961b8042cf0cf2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137379
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/generic/gen.cxx | 8 | ||||
-rw-r--r-- | tools/source/generic/poly.cxx | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 0452f8ea2049..69dc4d068ced 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -99,10 +99,10 @@ tools::Rectangle& tools::Rectangle::Intersection( const tools::Rectangle& rRect return *this; } - // Justify rectangle + // Normalize rectangle tools::Rectangle aTmpRect( rRect ); - Justify(); - aTmpRect.Justify(); + Normalize(); + aTmpRect.Normalize(); // Perform intersection mnLeft = std::max( mnLeft, aTmpRect.mnLeft ); @@ -117,7 +117,7 @@ tools::Rectangle& tools::Rectangle::Intersection( const tools::Rectangle& rRect return *this; } -void tools::Rectangle::Justify() +void tools::Rectangle::Normalize() { if ((mnRight < mnLeft) && (!IsWidthEmpty())) { diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 25f15d5fd00a..2c12ad777ec1 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -121,7 +121,7 @@ ImplPolygon::ImplPolygon( const tools::Rectangle& rRect, sal_uInt32 nHorzRound, if ( !rRect.IsEmpty() ) { tools::Rectangle aRect( rRect ); - aRect.Justify(); // SJ: i9140 + aRect.Normalize(); // SJ: i9140 nHorzRound = std::min( nHorzRound, static_cast<sal_uInt32>(std::abs( aRect.GetWidth() >> 1 )) ); nVertRound = std::min( nVertRound, static_cast<sal_uInt32>(std::abs( aRect.GetHeight() >> 1 )) ); @@ -1443,9 +1443,9 @@ void Polygon::Clip( const tools::Rectangle& rRect ) // Use PolyPolygon::Clip(). assert( !HasFlags()); - // #105251# Justify rect before edge filtering + // #105251# Normalize rect before edge filtering tools::Rectangle aJustifiedRect( rRect ); - aJustifiedRect.Justify(); + aJustifiedRect.Normalize(); sal_uInt16 nSourceSize = mpImplPolygon->mnPoints; ImplPolygonPointFilter aPolygon( nSourceSize ); |