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

Method onNodeSizeUpdated

QtNodeEditor/src/Node.cpp:217–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217void
218Node::
219onNodeSizeUpdated()
220{
221 int prev_width = nodeGeometry().width();
222 if( nodeDataModel()->embeddedWidget() )
223 {
224 nodeDataModel()->embeddedWidget()->adjustSize();
225 }
226 nodeGeometry().recalculateSize();
227 int new_width = nodeGeometry().width();
228
229 if( new_width != prev_width )
230 {
231 auto node_pos = nodeGraphicsObject().pos();
232 node_pos.setX( node_pos.x() - (new_width - prev_width)*0.5);
233 nodeGraphicsObject().setPos(node_pos);
234 }
235
236 for(PortType type: {PortType::In, PortType::Out})
237 {
238 for(auto& conn_set : nodeState().getEntries(type))
239 {
240 for(auto& pair: conn_set)
241 {
242 Connection* conn = pair.second;
243 conn->connectionGraphicsObject().move();
244 }
245 }
246 }
247}

Callers

nothing calls this directly

Calls 1

embeddedWidgetMethod · 0.80

Tested by

no test coverage detected