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

Function drawHoveredOrSelected

QtNodeEditor/src/ConnectionPainter.cpp:131–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131static
132void
133drawHoveredOrSelected(QPainter * painter,
134 Connection const & connection)
135{
136 using QtNodes::ConnectionGeometry;
137
138 ConnectionGeometry const& geom = connection.connectionGeometry();
139 bool const hovered = geom.hovered();
140
141 auto const& graphicsObject =
142 connection.connectionGraphicsObject();
143
144 bool const selected = graphicsObject.isSelected();
145
146 // drawn as a fat background
147 if (hovered || selected)
148 {
149 QPen p;
150
151 auto const & connectionStyle = connection.style();
152 double const lineWidth = connectionStyle.lineWidth();
153
154 p.setWidth(1.6 * lineWidth);
155 p.setColor(selected ?
156 connectionStyle.selectedHaloColor() :
157 connectionStyle.hoveredColor());
158
159 painter->setPen(p);
160 painter->setBrush(Qt::NoBrush);
161
162 // cubic spline
163 auto cubic = cubicPath(geom);
164 painter->drawPath(cubic);
165 }
166}
167
168
169static

Callers 1

paintMethod · 0.85

Calls 3

cubicPathFunction · 0.85
hoveredMethod · 0.80
lineWidthMethod · 0.80

Tested by

no test coverage detected