src/canvas.cpp

changeset 1110
ec3ee7da7806
parent 1108
90d6f4b7782e
child 1123
15e46ea3151f
equal deleted inserted replaced
1109:a55b2608a395 1110:ec3ee7da7806
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 }

mercurial