From 751d85f8c79de200d370a13d00afb37096e6312d Mon Sep 17 00:00:00 2001 From: attila Date: Thu, 9 Jun 2022 15:45:38 +0200 Subject: [PATCH] Component: Use the rounded integer mouse position when evaluating hitTest This commit reverts a small part of 4ca923a34b3cec79b50c3f1cb794f8327d7530a0. --- modules/juce_gui_basics/components/juce_Component.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp index 8b75f39c15..77c1a37e97 100644 --- a/modules/juce_gui_basics/components/juce_Component.cpp +++ b/modules/juce_gui_basics/components/juce_Component.cpp @@ -327,7 +327,7 @@ struct Component::ComponentHelpers static bool hitTest (Component& comp, Point localPoint) { const auto intPoint = localPoint.roundToInt(); - return Rectangle { comp.getWidth(), comp.getHeight() }.toFloat().contains (localPoint) + return Rectangle { comp.getWidth(), comp.getHeight() }.contains (intPoint) && comp.hitTest (intPoint.x, intPoint.y); }