From db90ce21c9182468b09040cb60d1857957bfaffe Mon Sep 17 00:00:00 2001 From: Jochen Becher Date: Thu, 14 Nov 2019 21:27:54 +0100 Subject: [PATCH] modeleditor: Fix intersection of relation with component Change-Id: Ib0a999e56f98bc2a4483583a322e107560c17dc0 Reviewed-by: Christian Stenger --- .../qmt/diagram_scene/items/componentitem.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libs/modelinglib/qmt/diagram_scene/items/componentitem.cpp b/src/libs/modelinglib/qmt/diagram_scene/items/componentitem.cpp index 96f0b8231cc..92b94a1b9ad 100644 --- a/src/libs/modelinglib/qmt/diagram_scene/items/componentitem.cpp +++ b/src/libs/modelinglib/qmt/diagram_scene/items/componentitem.cpp @@ -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);