Fixed issue #415. Line appears between the point and mark in the detail mode

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2015-12-07 07:48:51 +02:00
parent 0e60b20ace
commit d057d336f7

View file

@ -278,18 +278,26 @@ void VNodePoint::RefreshPointGeometry(const VPointF &point)
* @brief RefreshLine refresh label line on scene. * @brief RefreshLine refresh label line on scene.
*/ */
void VNodePoint::RefreshLine() void VNodePoint::RefreshLine()
{ { QRectF nRec = namePoint->sceneBoundingRect();
QRectF nameRec = namePoint->sceneBoundingRect(); nRec.translate(- scenePos());
QPointF p1, p2; if (this->rect().intersects(nRec) == false)
VGObject::LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), nameRec.center()- scenePos()), p1, p2); {
QPointF pRec = VGObject::LineIntersectRect(nameRec, QLineF(scenePos(), nameRec.center())); QRectF nameRec = namePoint->sceneBoundingRect();
lineName->setLine(QLineF(p1, pRec - scenePos())); QPointF p1, p2;
if (QLineF(p1, pRec - scenePos()).length() <= ToPixel(4, Unit::Mm)) VGObject::LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), nameRec.center()- scenePos()), p1, p2);
{ QPointF pRec = VGObject::LineIntersectRect(nameRec, QLineF(scenePos(), nameRec.center()));
lineName->setVisible(false); lineName->setLine(QLineF(p1, pRec - scenePos()));
} if (QLineF(p1, pRec - scenePos()).length() <= ToPixel(4, Unit::Mm))
else {
{ lineName->setVisible(false);
lineName->setVisible(true); }
} else
{
lineName->setVisible(true);
}
}
else
{
lineName->setVisible(false);
}
} }