Skip to content

Commit

Permalink
Fix float equality warning in Rectangle::enlargeIfAdjacent()
Browse files Browse the repository at this point in the history
Co-authored-by: Tobias Hienzsch <[email protected]>
  • Loading branch information
szarvas and tobiashienzsch committed Oct 24, 2023
1 parent 7626f86 commit c9c2ca0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/juce_graphics/geometry/juce_Rectangle.h
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ class Rectangle
*/
bool enlargeIfAdjacent (Rectangle other) noexcept
{
if (pos.x == other.pos.x && getRight() == other.getRight()
if (exactlyEqual (pos.x, other.pos.x) && exactlyEqual (getRight(), other.getRight())
&& (other.getBottom() >= pos.y && other.pos.y <= getBottom()))
{
auto newY = jmin (pos.y, other.pos.y);
Expand All @@ -750,7 +750,7 @@ class Rectangle
return true;
}

if (pos.y == other.pos.y && getBottom() == other.getBottom()
if (exactlyEqual (pos.y, other.pos.y) && exactlyEqual (getBottom(), other.getBottom())
&& (other.getRight() >= pos.x && other.pos.x <= getRight()))
{
auto newX = jmin (pos.x, other.pos.x);
Expand Down

0 comments on commit c9c2ca0

Please sign in to comment.