From 401e6ea5341d7616d17d0ef98fa9adb50c3822a0 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 8 Feb 2015 12:56:32 +0200 Subject: [PATCH] Leave line thick if tool was selected. --HG-- branch : feature --- src/app/tools/drawTools/vtoolline.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/tools/drawTools/vtoolline.cpp b/src/app/tools/drawTools/vtoolline.cpp index 797005bae..1f879afb9 100644 --- a/src/app/tools/drawTools/vtoolline.cpp +++ b/src/app/tools/drawTools/vtoolline.cpp @@ -307,8 +307,11 @@ void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event) void VToolLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { Q_UNUSED(event); - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, - LineStyleToPenStyle(typeLine))); + if (vis == nullptr) + { + this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, + LineStyleToPenStyle(typeLine))); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -449,6 +452,7 @@ void VToolLine::ShowVisualization(bool show) { delete vis; vis = nullptr; + hoverLeaveEvent(nullptr); } } @@ -497,6 +501,5 @@ void VToolLine::RefreshGeometry() const QSharedPointer first = VAbstractTool::data.GeometricObject(firstPoint); const QSharedPointer second = VAbstractTool::data.GeometricObject(secondPoint); this->setLine(QLineF(first->toQPointF(), second->toQPointF())); - this->setPen(QPen(CorrectColor(lineColor), qApp->toPixel(qApp->widthHairLine())/factor, - LineStyleToPenStyle(typeLine))); + this->setPen(QPen(CorrectColor(lineColor), pen().widthF(), LineStyleToPenStyle(typeLine))); }