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:
parent
1e240aeb48
commit
92545f9deb
1 changed files with 8 additions and 1 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue