1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Convert mouse coordinate to correct Component space when dragging SidePanel

This commit is contained in:
ed 2017-11-10 11:23:24 +00:00
parent 1e240aeb48
commit 92545f9deb

View file

@ -133,7 +133,14 @@ void SidePanel::mouseDrag (const MouseEvent& e)
{
if (shouldResize)
{
auto currentMouseDragX = static_cast<int> (e.position.x);
Point<int> convertedPoint;
if (getParentComponent() == nullptr)
convertedPoint = e.eventComponent->localPointToGlobal (e.getPosition());
else
convertedPoint = getParentComponent()->getLocalPoint (e.eventComponent, e.getPosition());
auto currentMouseDragX = convertedPoint.x;
if (isOnLeft)
{