diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2018-09-21 09:19:21 +0200 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2018-09-21 09:19:21 +0200 |
commit | 1f57600e248bc4171dbf72e211b3b061045ebeb4 (patch) | |
tree | a0ffe0cc6561183fa0bbab92383987c3ef7219cb | |
parent | 5e5a98b97871ebaa3899e2f1bf08534e32f1f983 (diff) |
fixed edge selection bug
-rw-r--r-- | src/gui/edgeitem.cpp | 11 | ||||
-rw-r--r-- | 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()) { |