modeleditor: Fix intersection of relation with component

Change-Id: Ib0a999e56f98bc2a4483583a322e107560c17dc0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Jochen Becher
2019-11-14 21:27:54 +01:00
parent c37ecdeaf1
commit db90ce21c9

View File

@@ -177,10 +177,14 @@ bool ComponentItem::intersectShapeWithLine(const QLineF &line, QPointF *intersec
<< rect.topRight()
<< rect.bottomRight()
<< rect.bottomLeft()
<< rect.bottomLeft() + QPointF(0, UPPER_RECT_Y + RECT_HEIGHT + RECT_Y_DISTANCE + RECT_HEIGHT)
<< rect.bottomLeft() + QPointF(-RECT_WIDTH * 0.5, UPPER_RECT_Y + RECT_HEIGHT + RECT_Y_DISTANCE + RECT_HEIGHT)
<< rect.bottomLeft() + QPointF(-RECT_WIDTH * 0.5, UPPER_RECT_Y)
<< rect.bottomLeft() + QPointF(0, UPPER_RECT_Y)
<< rect.topLeft() + QPointF(0, UPPER_RECT_Y + RECT_HEIGHT + RECT_Y_DISTANCE + RECT_HEIGHT)
<< rect.topLeft() + QPointF(-RECT_WIDTH * 0.5, UPPER_RECT_Y + RECT_HEIGHT + RECT_Y_DISTANCE + RECT_HEIGHT)
<< rect.topLeft() + QPointF(-RECT_WIDTH * 0.5, UPPER_RECT_Y + RECT_HEIGHT + RECT_Y_DISTANCE)
<< rect.topLeft() + QPointF(0, UPPER_RECT_Y + RECT_HEIGHT + RECT_Y_DISTANCE)
<< rect.topLeft() + QPointF(0, UPPER_RECT_Y + RECT_HEIGHT)
<< rect.topLeft() + QPointF(-RECT_WIDTH * 0.5, UPPER_RECT_Y + RECT_HEIGHT)
<< rect.topLeft() + QPointF(-RECT_WIDTH * 0.5, UPPER_RECT_Y)
<< rect.topLeft() + QPointF(0, UPPER_RECT_Y)
<< rect.topLeft();
}
return GeometryUtilities::intersect(polygon, line, intersectionPoint, intersectionLine);