MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / boundingRect

Method boundingRect

QtNodeEditor/src/ConnectionGeometry.cpp:73–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72
73QRectF
74ConnectionGeometry::
75boundingRect() const
76{
77 auto points = pointsC1C2();
78
79 QRectF basicRect = QRectF(_out, _in).normalized();
80
81 QRectF c1c2Rect = QRectF(points.first, points.second).normalized();
82
83 auto const &connectionStyle =
84 StyleCollection::connectionStyle();
85
86 float const diam = connectionStyle.pointDiameter();
87
88 QRectF commonRect = basicRect.united(c1c2Rect);
89
90 QPointF const cornerOffset(diam, diam);
91
92 commonRect.setTopLeft(commonRect.topLeft() - cornerOffset);
93 commonRect.setBottomRight(commonRect.bottomRight() + 2 * cornerOffset);
94
95 return commonRect;
96}
97
98
99std::pair<QPointF, QPointF>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected