From 1f57600e248bc4171dbf72e211b3b061045ebeb4 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 21 Sep 2018 09:19:21 +0200 Subject: fixed edge selection bug --- src/gui/edgeitem.cpp | 11 ++++++++--- src/gui/tikzscene.cpp | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/edgeitem.cpp b/src/gui/edgeitem.cpp index f469506..146b4e0 100644 --- a/src/gui/edgeitem.cpp +++ b/src/gui/edgeitem.cpp @@ -102,7 +102,12 @@ void EdgeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->drawPath(pth); break; } - } + } + + //QPen outline = QPen(Qt::red); + //painter->setPen(outline); + //painter->drawPath(_expPath); + //painter->setPen(pen); switch (_edge->style()->arrowTail()) { case EdgeStyle::Flat: @@ -209,9 +214,9 @@ void EdgeItem::setPath(const QPainterPath &path) // get the shape of the edge, and expand a bit to make selection easier QPainterPathStroker stroker; - stroker.setWidth(5); + stroker.setWidth(8); stroker.setJoinStyle(Qt::MiterJoin); - _expPath = (stroker.createStroke(_path) + _path).simplified(); + _expPath = stroker.createStroke(_path).simplified(); float r = GLOBAL_SCALEF * (_edge->cpDist() + 0.2); _boundingRect = _path.boundingRect().adjusted(-r,-r,r,r); diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp index 8950325..2a37014 100644 --- a/src/gui/tikzscene.cpp +++ b/src/gui/tikzscene.cpp @@ -164,7 +164,7 @@ void TikzScene::mousePressEvent(QGraphicsSceneMouseEvent *event) if (items(_mouseDownPos).isEmpty()) { _rubberBandItem->setRect(QRectF(_mouseDownPos,_mouseDownPos)); _rubberBandItem->setVisible(true); - qDebug() << "starting rubber band drag"; + //qDebug() << "starting rubber band drag"; } // foreach (QGraphicsItem *gi, items()) { -- cgit v1.2.3