MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / itemDropped

Method itemDropped

Source/UIComponents/CtrlrPanel/CtrlrPanelCanvas.cpp:1398–1429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1396}
1397
1398void CtrlrPanelCanvas::itemDropped (const SourceDetails &dragSourceDetails)
1399{
1400 if (getOwner().getSelection() == nullptr)
1401 return;
1402
1403 for (int i = 0; i < getOwner().getSelection()->getNumSelected(); ++i)
1404 {
1405 CtrlrComponent* const c = getOwner().getSelection()->getSelectedItem (i);
1406
1407 if (c != nullptr)
1408 {
1409 if ((bool)c->getProperty(Ids::componentIsLocked) == true)
1410 return;
1411 }
1412 }
1413
1414 if (dragSourceDetails.description == "__ctrlr_component_selection")
1415 {
1416 AffineTransform trans = owner.getOwner().getEditor()->moveSelectionToPosition(dragSourceDetails.localPosition.getX(), dragSourceDetails.localPosition.getY());
1417
1418 for (int i=0; i<owner.getSelection()->getNumSelected(); i++)
1419 {
1420 CtrlrComponent *child = owner.getSelection()->getSelectedItem(i);
1421
1422 if ( (bool)child->getProperty (Ids::componentGroupped) == true)
1423 {
1424 child->setProperty (Ids::componentGroupped, false, true);
1425 owner.getSelection()->getSelectedItem(i)->setBounds (owner.getSelection()->getSelectedItem(i)->getBounds().transformedBy(trans));
1426 }
1427 }
1428 }
1429}
1430
1431void CtrlrPanelCanvas::itemDragExit (const SourceDetails &dragSourceDetails)
1432{

Callers

nothing calls this directly

Calls 13

getSelectionMethod · 0.80
getNumSelectedMethod · 0.80
getSelectedItemMethod · 0.80
getPropertyMethod · 0.45
getEditorMethod · 0.45
getOwnerMethod · 0.45
getXMethod · 0.45
getYMethod · 0.45
setPropertyMethod · 0.45
setBoundsMethod · 0.45
transformedByMethod · 0.45

Tested by

no test coverage detected