diff --git a/modules/juce_gui_basics/layout/juce_SidePanel.cpp b/modules/juce_gui_basics/layout/juce_SidePanel.cpp index cc09b804f8..c2b3d07207 100644 --- a/modules/juce_gui_basics/layout/juce_SidePanel.cpp +++ b/modules/juce_gui_basics/layout/juce_SidePanel.cpp @@ -133,7 +133,14 @@ void SidePanel::mouseDrag (const MouseEvent& e) { if (shouldResize) { - auto currentMouseDragX = static_cast (e.position.x); + Point convertedPoint; + + if (getParentComponent() == nullptr) + convertedPoint = e.eventComponent->localPointToGlobal (e.getPosition()); + else + convertedPoint = getParentComponent()->getLocalPoint (e.eventComponent, e.getPosition()); + + auto currentMouseDragX = convertedPoint.x; if (isOnLeft) {