From c9c2ca0aab5f2da55729baafc024c8d17fe3c79d Mon Sep 17 00:00:00 2001 From: attila Date: Tue, 24 Oct 2023 15:32:17 +0200 Subject: [PATCH] Fix float equality warning in Rectangle::enlargeIfAdjacent() Co-authored-by: Tobias Hienzsch --- modules/juce_graphics/geometry/juce_Rectangle.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/juce_graphics/geometry/juce_Rectangle.h b/modules/juce_graphics/geometry/juce_Rectangle.h index 830aa7b85128..942871a49171 100644 --- a/modules/juce_graphics/geometry/juce_Rectangle.h +++ b/modules/juce_graphics/geometry/juce_Rectangle.h @@ -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); @@ -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);