mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
DragAndDropContainer: fix positioning when source Component is transformed
This commit is contained in:
parent
a7915ec47e
commit
823bfb0c32
1 changed files with 6 additions and 1 deletions
|
|
@ -44,7 +44,7 @@ public:
|
|||
: sourceDetails (desc, sourceComponent, Point<int>()),
|
||||
image (im), owner (ddc),
|
||||
mouseDragSource (draggingSource->getComponentUnderMouse()),
|
||||
imageOffset (offset),
|
||||
imageOffset (transformOffsetCoordinates (sourceComponent, offset)),
|
||||
originalInputSourceIndex (draggingSource->getIndex()),
|
||||
originalInputSourceType (draggingSource->getType())
|
||||
{
|
||||
|
|
@ -263,6 +263,11 @@ private:
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Point<int> transformOffsetCoordinates (const Component* const sourceComponent, Point<int> offsetInSource) const
|
||||
{
|
||||
return getLocalPoint (sourceComponent, offsetInSource) - getLocalPoint (sourceComponent, Point<int>());
|
||||
}
|
||||
|
||||
DragAndDropTarget* findTarget (Point<int> screenPos, Point<int>& relativePos,
|
||||
Component*& resultComponent) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue