diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-09-17 21:49:21 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2021-09-20 12:10:44 +0200 |
commit | b22d4785310eac35696df771803dfba0871a50ac (patch) | |
tree | 56e394a3c38a2e1f17530fbc18dd8e6b3c5d5098 /tools/source/generic/gen.cxx | |
parent | 3e2370260f2b79c43b4f8a86b123861aa95d3ef2 (diff) |
clean up ambiguous confusing rectangle APIs like IsInside()
Reading 'rectA.IsInside( rectB )' kind of suggests that the code
checks whether 'rectA is inside rectB', but it's actually the other
way around. Rename IsInside() -> Contains(), IsOver() -> Overlaps(),
which should make it clear which way the logic goes.
Change-Id: I9347450fe7dc34c96df6d636a4e3e660de1801ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122271
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'tools/source/generic/gen.cxx')
-rw-r--r-- | tools/source/generic/gen.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 9c9c04903f19..1fe47071d4ce 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -140,7 +140,7 @@ void tools::Rectangle::Justify() } } -bool tools::Rectangle::IsInside( const Point& rPoint ) const +bool tools::Rectangle::Contains( const Point& rPoint ) const { if ( IsEmpty() ) return false; @@ -168,12 +168,12 @@ bool tools::Rectangle::IsInside( const Point& rPoint ) const return true; } -bool tools::Rectangle::IsInside( const tools::Rectangle& rRect ) const +bool tools::Rectangle::Contains( const tools::Rectangle& rRect ) const { - return IsInside( rRect.TopLeft() ) && IsInside( rRect.BottomRight() ); + return Contains( rRect.TopLeft() ) && Contains( rRect.BottomRight() ); } -bool tools::Rectangle::IsOver( const tools::Rectangle& rRect ) const +bool tools::Rectangle::Overlaps( const tools::Rectangle& rRect ) const { // If there's no intersection, they don't overlap return !GetIntersection( rRect ).IsEmpty(); |