Extend drawable Area of Juce Component

I created a draggable Component represented/drawn by an inner(black) and outter(red) Circle.

I want it to be only draggable, when the mouse is inside the inner circle. The components outter circular region should not receive any mousecallbacks and it should not overshadow other components mouse events.

Which is the best way to accomplish the described behaviour? Thank You!

This is done by overriding bool hitTest (int x, int y) to only return true when x, y is inside the inner circle:

bool MyComponent::hitTest (int x, int y) override
{
    auto centre = getLocalBounds().getCentre();
    return centre.getDistanceFrom ({x, y}) <= innerRadius;
}
1 Like

Merci!