1401 ev->accept(); |
1401 ev->accept(); |
1402 } |
1402 } |
1403 |
1403 |
1404 // ============================================================================= |
1404 // ============================================================================= |
1405 // |
1405 // |
1406 LDOverlayPtr GLRenderer::findOverlayObject (ECamera cam) |
1406 LDOverlay* GLRenderer::findOverlayObject (ECamera cam) |
1407 { |
1407 { |
1408 for (LDObject* obj : document()->objects()) |
1408 for (LDObject* obj : document()->objects()) |
1409 { |
1409 { |
1410 LDOverlayPtr overlay = dynamic_cast<LDOverlay*> (obj); |
1410 LDOverlay* overlay = dynamic_cast<LDOverlay*> (obj); |
1411 |
1411 |
1412 if (overlay and overlay->camera() == cam) |
1412 if (overlay and overlay->camera() == cam) |
1413 return overlay; |
1413 return overlay; |
1414 } |
1414 } |
1415 |
1415 |
1453 { |
1453 { |
1454 if (cam == EFreeCamera) |
1454 if (cam == EFreeCamera) |
1455 continue; |
1455 continue; |
1456 |
1456 |
1457 LDGLOverlay& meta = currentDocumentData().overlays[cam]; |
1457 LDGLOverlay& meta = currentDocumentData().overlays[cam]; |
1458 LDOverlayPtr ovlobj = findOverlayObject (cam); |
1458 LDOverlay* ovlobj = findOverlayObject (cam); |
1459 |
1459 |
1460 if (meta.img == null and ovlobj != null) |
1460 if (meta.img == null and ovlobj != null) |
1461 { |
1461 { |
1462 // If this is the last overlay image, we need to remove the empty space after it as well. |
1462 // If this is the last overlay image, we need to remove the empty space after it as well. |
1463 LDObject* nextobj = ovlobj->next(); |
1463 LDObject* nextobj = ovlobj->next(); |
1529 void GLRenderer::highlightCursorObject() |
1529 void GLRenderer::highlightCursorObject() |
1530 { |
1530 { |
1531 if (not cfg::HighlightObjectBelowCursor and objectAtCursor() == null) |
1531 if (not cfg::HighlightObjectBelowCursor and objectAtCursor() == null) |
1532 return; |
1532 return; |
1533 |
1533 |
1534 LDObjectWeakPtr newObject; |
1534 LDObject* newObject; |
1535 LDObjectWeakPtr oldObject = objectAtCursor(); |
1535 LDObject* oldObject = objectAtCursor(); |
1536 qint32 newIndex; |
1536 qint32 newIndex; |
1537 |
1537 |
1538 if (isCameraMoving() or not cfg::HighlightObjectBelowCursor) |
1538 if (isCameraMoving() or not cfg::HighlightObjectBelowCursor) |
1539 { |
1539 { |
1540 newIndex = 0; |
1540 newIndex = 0; |
1576 void GLRenderer::dropEvent (QDropEvent* ev) |
1576 void GLRenderer::dropEvent (QDropEvent* ev) |
1577 { |
1577 { |
1578 if (g_win != null and ev->source() == g_win->getPrimitivesTree()) |
1578 if (g_win != null and ev->source() == g_win->getPrimitivesTree()) |
1579 { |
1579 { |
1580 QString primName = static_cast<SubfileListItem*> (g_win->getPrimitivesTree()->currentItem())->primitive()->name; |
1580 QString primName = static_cast<SubfileListItem*> (g_win->getPrimitivesTree()->currentItem())->primitive()->name; |
1581 LDSubfilePtr ref = LDSpawn<LDSubfile>(); |
1581 LDSubfile* ref = LDSpawn<LDSubfile>(); |
1582 ref->setColor (MainColor()); |
1582 ref->setColor (MainColor()); |
1583 ref->setFileInfo (GetDocument (primName)); |
1583 ref->setFileInfo (GetDocument (primName)); |
1584 ref->setPosition (Origin); |
1584 ref->setPosition (Origin); |
1585 ref->setTransform (IdentityMatrix); |
1585 ref->setTransform (IdentityMatrix); |
1586 LDDocument::current()->insertObj (g_win->getInsertionPoint(), ref); |
1586 LDDocument::current()->insertObj (g_win->getInsertionPoint(), ref); |