Leave line thick if tool was selected.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2015-02-08 12:56:32 +02:00
parent eb56288d13
commit 401e6ea534

View File

@ -307,9 +307,12 @@ void VToolLine::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
void VToolLine::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
Q_UNUSED(event);
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<VPointF> first = VAbstractTool::data.GeometricObject<VPointF>(firstPoint);
const QSharedPointer<VPointF> second = VAbstractTool::data.GeometricObject<VPointF>(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)));
}