aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/modelinglib
diff options
context:
space:
mode:
authorJochen Becher <jochen_becher@gmx.de>2019-11-14 21:27:54 +0100
committerJochen Becher <jochen_becher@gmx.de>2020-02-23 15:54:24 +0000
commitdb90ce21c9182468b09040cb60d1857957bfaffe (patch)
treeb30bbc101f5e96171fc86278dcc04380cb321a09 /src/libs/modelinglib
parentc37ecdeaf11cf4da7125540d772333975b440046 (diff)
modeleditor: Fix intersection of relation with component
Change-Id: Ib0a999e56f98bc2a4483583a322e107560c17dc0 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/libs/modelinglib')
-rw-r--r--src/libs/modelinglib/qmt/diagram_scene/items/componentitem.cpp12
1 files 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);