Browse Source

Component: Use the rounded integer mouse position when evaluating hitTest

This commit reverts a small part of
4ca923a34b.
pull/22/head
attila 3 years ago
parent
commit
751d85f8c7
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      modules/juce_gui_basics/components/juce_Component.cpp

+ 1
- 1
modules/juce_gui_basics/components/juce_Component.cpp View File

@@ -327,7 +327,7 @@ struct Component::ComponentHelpers
static bool hitTest (Component& comp, Point<float> localPoint) static bool hitTest (Component& comp, Point<float> localPoint)
{ {
const auto intPoint = localPoint.roundToInt(); const auto intPoint = localPoint.roundToInt();
return Rectangle<int> { comp.getWidth(), comp.getHeight() }.toFloat().contains (localPoint)
return Rectangle<int> { comp.getWidth(), comp.getHeight() }.contains (intPoint)
&& comp.hitTest (intPoint.x, intPoint.y); && comp.hitTest (intPoint.x, intPoint.y);
} }


Loading…
Cancel
Save