diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2017-12-22 16:19:28 +0000 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2017-12-22 16:19:28 +0000 |
commit | fcc0fc080370c0c8e97a0c07043b83240d973cab (patch) | |
tree | 21493478f225955a75c9f7aa207db3a86a9db2cd /tikzit/src/gui | |
parent | d8db367f6a4e49776834c82b092700dbda56cecc (diff) |
graphs no longer allocate edges and nodes (but they do still own them)
Diffstat (limited to 'tikzit/src/gui')
-rw-r--r-- | tikzit/src/gui/tikzscene.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tikzit/src/gui/tikzscene.cpp b/tikzit/src/gui/tikzscene.cpp index 619d916..a900192 100644 --- a/tikzit/src/gui/tikzscene.cpp +++ b/tikzit/src/gui/tikzscene.cpp @@ -52,8 +52,11 @@ void TikzScene::graphReplaced() void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) { // current mouse position, in scene coordinates - QPointF mousePos(event->buttonDownScenePos(Qt::LeftButton).x(), - event->buttonDownScenePos(Qt::LeftButton).y()); + QPointF mousePos = event->scenePos(); + + // disable rubber band drag, which will clear the selection. Only re-enable it + // for the SELECT tool, and when no control point has been clicked. + views()[0]->setDragMode(QGraphicsView::NoDrag); // radius of a control point for bezier edges, in scene coordinates qreal cpR = GLOBAL_SCALEF * (0.05); @@ -87,9 +90,6 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) } if (_modifyEdgeItem != 0) { - // disable rubber band drag, which will clear the selection - views()[0]->setDragMode(QGraphicsView::NoDrag); - // store for undo purposes Edge *e = _modifyEdgeItem->edge(); _oldBend = e->bend(); @@ -123,7 +123,6 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { // current mouse position, in scene coordinates - QPointF mousePos = event->scenePos(); switch (tikzit->toolPalette()->currentTool()) { @@ -225,6 +224,9 @@ void TikzScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { + // current mouse position, in scene coordinates + QPointF mousePos = event->scenePos(); + switch (tikzit->toolPalette()->currentTool()) { case ToolPalette::SELECT: if (_modifyEdgeItem != 0) { @@ -265,6 +267,7 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) break; case ToolPalette::VERTEX: + // TODO break; case ToolPalette::EDGE: break; |