mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fixed a bug when performing a DragAndDrop across windows
This commit is contained in:
parent
b8b25ac487
commit
e763ac3de2
1 changed files with 1 additions and 18 deletions
|
|
@ -243,30 +243,13 @@ private:
|
|||
return dynamic_cast<DragAndDropTarget*> (currentlyOverComp.get());
|
||||
}
|
||||
|
||||
static Component* findDesktopComponentBelow (Point<int> screenPos)
|
||||
{
|
||||
auto& desktop = Desktop::getInstance();
|
||||
|
||||
for (auto i = desktop.getNumComponents(); --i >= 0;)
|
||||
{
|
||||
auto* desktopComponent = desktop.getComponent (i);
|
||||
auto localPoint = desktopComponent->getLocalPoint (nullptr, screenPos);
|
||||
|
||||
if (auto* c = desktopComponent->getComponentAt (localPoint))
|
||||
if (c->hitTest (localPoint.getX(), localPoint.getY()))
|
||||
return c;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DragAndDropTarget* findTarget (Point<int> screenPos, Point<int>& relativePos,
|
||||
Component*& resultComponent) const
|
||||
{
|
||||
auto* hit = getParentComponent();
|
||||
|
||||
if (hit == nullptr)
|
||||
hit = findDesktopComponentBelow (screenPos);
|
||||
hit = Desktop::getInstance().findComponentAt (screenPos);
|
||||
else
|
||||
hit = hit->getComponentAt (hit->getLocalPoint (nullptr, screenPos));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue