From d057d336f7f197804d5bf7561411358aca1a5c55 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Mon, 7 Dec 2015 07:48:51 +0200 Subject: [PATCH] Fixed issue #415. Line appears between the point and mark in the detail mode --HG-- branch : feature --- .../vtools/tools/nodeDetails/vnodepoint.cpp | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp index 18b0f38cb..9ae32e966 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp @@ -278,18 +278,26 @@ void VNodePoint::RefreshPointGeometry(const VPointF &point) * @brief RefreshLine refresh label line on scene. */ void VNodePoint::RefreshLine() -{ - QRectF nameRec = namePoint->sceneBoundingRect(); - QPointF p1, p2; - VGObject::LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), nameRec.center()- scenePos()), p1, p2); - QPointF pRec = VGObject::LineIntersectRect(nameRec, QLineF(scenePos(), nameRec.center())); - lineName->setLine(QLineF(p1, pRec - scenePos())); - if (QLineF(p1, pRec - scenePos()).length() <= ToPixel(4, Unit::Mm)) - { - lineName->setVisible(false); - } - else - { - lineName->setVisible(true); - } +{ QRectF nRec = namePoint->sceneBoundingRect(); + nRec.translate(- scenePos()); + if (this->rect().intersects(nRec) == false) + { + QRectF nameRec = namePoint->sceneBoundingRect(); + QPointF p1, p2; + VGObject::LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), nameRec.center()- scenePos()), p1, p2); + QPointF pRec = VGObject::LineIntersectRect(nameRec, QLineF(scenePos(), nameRec.center())); + lineName->setLine(QLineF(p1, pRec - scenePos())); + if (QLineF(p1, pRec - scenePos()).length() <= ToPixel(4, Unit::Mm)) + { + lineName->setVisible(false); + } + else + { + lineName->setVisible(true); + } + } + else + { + lineName->setVisible(false); + } }