| 28 | } |
| 29 | |
| 30 | bool ModulatableSlider::hitTest(int x, int y) |
| 31 | { |
| 32 | auto sliderBounds = getLocalBounds(); |
| 33 | auto center = sliderBounds.getCentre().toFloat(); |
| 34 | auto distFromCentre = juce::Point<float>((float) x, (float) y).getDistanceFrom(center); |
| 35 | |
| 36 | auto outerBounds = sliderBounds.toFloat().reduced(10); |
| 37 | auto outerRadius = juce::jmin(outerBounds.getWidth(), outerBounds.getHeight()) / 2.0f; |
| 38 | float maxSliderClickableRadius = outerRadius + (outerRadius * 0.2f * 0.5f); |
| 39 | |
| 40 | if (distFromCentre <= maxSliderClickableRadius) |
| 41 | { |
| 42 | return true; |
| 43 | } |
| 44 | |
| 45 | if (isModulated && getModulationHandleBounds().contains((float) x, (float) y)) |
| 46 | { |
| 47 | return true; |
| 48 | } |
| 49 | |
| 50 | return false; |
| 51 | } |
| 52 | |
| 53 | juce::Rectangle<float> ModulatableSlider::getModulationHandleBounds() |
| 54 | { |
nothing calls this directly
no outgoing calls
no test coverage detected