Skip to content

Commit df18e9c

Browse files
committed
Updated link curves
1 parent 1fea876 commit df18e9c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

UI/LinkItem.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ bool LinkItem::hasPins(PinItem *_pinA, PinItem *_pinB)
141141

142142
void LinkItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
143143
{
144-
Q_UNUSED(option);
145-
Q_UNUSED(widget);
144+
Q_UNUSED(option)
145+
Q_UNUSED(widget)
146146

147147
if(m_pinA != nullptr || m_pinB != nullptr)
148148
{
@@ -192,9 +192,8 @@ QPainterPath LinkItem::getLinePath() const
192192
}
193193
qreal secondPointSign = -firstPointSign;
194194

195-
qreal minDist = 200.0;
196195
qreal alpha = 0.6;
197-
qreal dist = qMax(abs(firstPoint.x() - secondPoint.x()), minDist);
196+
qreal dist = qMax(abs(firstPoint.x() - secondPoint.x()), abs(firstPoint.y() - secondPoint.y()));
198197
QPointF ctrlPoint1(firstPoint.x() + firstPointSign * dist * alpha, firstPoint.y());
199198
QPointF ctrlPoint2(secondPoint.x() + secondPointSign * dist * alpha, secondPoint.y());
200199

0 commit comments

Comments
 (0)