Skip to content

Commit

Permalink
Fix float equality warning in Rectangle::enlargeIfAdjacent
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Oct 16, 2023
1 parent 5c8b7fe commit b69d8c1
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 b69d8c1

Please sign in to comment.