1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fix float equality warning in Rectangle::enlargeIfAdjacent()

Co-authored-by: Tobias Hienzsch <post@tobias-hienzsch.de>
This commit is contained in:
attila 2023-10-24 15:32:17 +02:00
parent 7626f86607
commit c9c2ca0aab

View file

@ -741,7 +741,7 @@ public:
*/
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 @@ public:
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);