ui: offset Edges to left or right whether they go up or down to avoid overlapping of different directions

This commit is contained in:
Eberhard Graether
2015-02-10 15:19:28 +01:00
parent b8f6b4be4e
commit 1fd7703995
+14 -2
View File
@@ -289,8 +289,8 @@ QPolygon QtCorneredConnection::getPath() const
}
}
float offsetO = 15;
float offsetT = m_big ? 25 : 15;
float offsetO = 17;
float offsetT = m_big ? 29 : 17;
QPoint tp((it ? 1 : -1) * offsetT + t[it].x, t[it].y);
QPoint op((io ? 1 : -1) * offsetO + o[io].x, o[io].y);
@@ -333,6 +333,18 @@ QPolygon QtCorneredConnection::getPath() const
t[0] = Vec2f(tR.x, (2 * tR.y + tR.w) / 3);
t[1] = Vec2f(tR.z, (2 * tR.y + tR.w) / 3);
int verticalOffset = 3;
if (o[io].y < t[it].y)
{
op.setX(op.x() + verticalOffset);
tp.setX(tp.x() + verticalOffset);
}
else
{
op.setX(op.x() - verticalOffset);
tp.setX(tp.x() - verticalOffset);
}
QPolygon poly;
poly << QPoint(t[it].x, t[it].y);
poly << tp;