308 int rx = (((position3d[axisX] * signX) + virtualWidth() + panning(X)) * width()) / (2 * virtualWidth()); |
308 int rx = (((position3d[axisX] * signX) + virtualWidth() + panning(X)) * width()) / (2 * virtualWidth()); |
309 int ry = (((position3d[axisY] * signY) - virtualHeight() + panning(Y)) * height()) / (2 * virtualHeight()); |
309 int ry = (((position3d[axisY] * signY) - virtualHeight() + panning(Y)) * height()) / (2 * virtualHeight()); |
310 return {rx, -ry}; |
310 return {rx, -ry}; |
311 } |
311 } |
312 } |
312 } |
|
313 |
|
314 void Canvas::contextMenuEvent(QContextMenuEvent* event) |
|
315 { |
|
316 m_window->spawnContextMenu(event->globalPos()); |
|
317 } |
|
318 |
|
319 void Canvas::dragEnterEvent(QDragEnterEvent* event) |
|
320 { |
|
321 if (m_window and event->source() == m_window->getPrimitivesTree() and m_window->getPrimitivesTree()->currentItem()) |
|
322 event->acceptProposedAction(); |
|
323 } |