Browse Source

Fix float equality warning in Rectangle::enlargeIfAdjacent()

Co-authored-by: Tobias Hienzsch <post@tobias-hienzsch.de>
v7.0.9
attila 2 years ago
parent
commit
c9c2ca0aab
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      modules/juce_graphics/geometry/juce_Rectangle.h

+ 2
- 2
modules/juce_graphics/geometry/juce_Rectangle.h View File

@@ -741,7 +741,7 @@ public:
*/ */
bool enlargeIfAdjacent (Rectangle other) noexcept 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())) && (other.getBottom() >= pos.y && other.pos.y <= getBottom()))
{ {
auto newY = jmin (pos.y, other.pos.y); auto newY = jmin (pos.y, other.pos.y);
@@ -750,7 +750,7 @@ public:
return true; 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())) && (other.getRight() >= pos.x && other.pos.x <= getRight()))
{ {
auto newX = jmin (pos.x, other.pos.x); auto newX = jmin (pos.x, other.pos.x);


Loading…
Cancel
Save