We don't need to change pen inside RefreshLine method
--HG-- branch : feature
This commit is contained in:
parent
0869c7fed4
commit
a1417fc127
|
@ -247,10 +247,8 @@ void VToolSinglePoint::RefreshPointGeometry(const VPointF &point)
|
|||
void VToolSinglePoint::RefreshLine(quint32 id)
|
||||
{
|
||||
Q_UNUSED(id)
|
||||
QPen pen(CorrectColor(Qt::black));
|
||||
pen.setWidthF(qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor);
|
||||
|
||||
VAbstractTool::RefreshLine(this, namePoint, lineName, radius, pen);
|
||||
VAbstractTool::RefreshLine(this, namePoint, lineName, radius);
|
||||
lineName->setPen(QPen(CorrectColor(Qt::black), qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -279,5 +279,5 @@ void VNodePoint::RefreshPointGeometry(const VPointF &point)
|
|||
*/
|
||||
void VNodePoint::RefreshLine()
|
||||
{
|
||||
VAbstractTool::RefreshLine(this, namePoint, lineName, radius, QPen(Qt::black));
|
||||
VAbstractTool::RefreshLine(this, namePoint, lineName, radius);
|
||||
}
|
||||
|
|
|
@ -321,7 +321,7 @@ void VAbstractTool::AddRecord(const quint32 id, const Tool &toolType, VAbstractP
|
|||
* @brief RefreshLine refresh line to label on scene.
|
||||
*/
|
||||
void VAbstractTool::RefreshLine(QGraphicsEllipseItem *point, VGraphicsSimpleTextItem *namePoint, QGraphicsLineItem *lineName,
|
||||
const qreal radius, const QPen pen)
|
||||
const qreal radius)
|
||||
{
|
||||
QRectF nRec = namePoint->sceneBoundingRect();
|
||||
nRec.translate(- point->scenePos());
|
||||
|
@ -332,7 +332,6 @@ void VAbstractTool::RefreshLine(QGraphicsEllipseItem *point, VGraphicsSimpleText
|
|||
VGObject::LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), nameRec.center() - point->scenePos()), p1, p2);
|
||||
const QPointF pRec = VGObject::LineIntersectRect(nameRec, QLineF(point->scenePos(), nameRec.center()));
|
||||
lineName->setLine(QLineF(p1, pRec - point->scenePos()));
|
||||
lineName->setPen(pen);
|
||||
|
||||
if (QLineF(p1, pRec - point->scenePos()).length() <= ToPixel(4, Unit::Mm))
|
||||
{
|
||||
|
|
|
@ -124,7 +124,7 @@ protected:
|
|||
void ToolCreation(const Source &typeCreation);
|
||||
|
||||
static void RefreshLine(QGraphicsEllipseItem *point, VGraphicsSimpleTextItem *namePoint, QGraphicsLineItem *lineName,
|
||||
const qreal radius, const QPen pen);
|
||||
const qreal radius);
|
||||
private:
|
||||
Q_DISABLE_COPY(VAbstractTool)
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user