Hide line to control point if the center of connection is inside of the point.
--HG-- branch : develop
This commit is contained in:
parent
21b3f4b5ae
commit
f2c8481f53
|
@ -272,14 +272,23 @@ void VControlPointSpline::Init()
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VControlPointSpline::SetCtrlLine(const QPointF &controlPoint, const QPointF &splinePoint)
|
||||
{
|
||||
QPointF p1, p2;
|
||||
VGObject::LineIntersectCircle(QPointF(), ScaledRadius(SceneScale(scene())),
|
||||
QLineF( QPointF(), splinePoint-controlPoint), p1, p2);
|
||||
QLineF line(splinePoint-controlPoint, p1);
|
||||
controlLine->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
|
||||
controlLine->setLine(line);
|
||||
controlLine->setVisible(not line.isNull());
|
||||
controlLine->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||
QLineF circleLine (QPointF(), splinePoint-controlPoint);
|
||||
const qreal radius = ScaledRadius(SceneScale(scene()));
|
||||
|
||||
if (circleLine.length() > radius)
|
||||
{
|
||||
QPointF p1, p2;
|
||||
VGObject::LineIntersectCircle(QPointF(), radius, circleLine, p1, p2);
|
||||
QLineF line(splinePoint-controlPoint, p1);
|
||||
controlLine->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
|
||||
controlLine->setLine(line);
|
||||
controlLine->setVisible(not line.isNull());
|
||||
controlLine->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
controlLine->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue
Block a user