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

Method recalculateSize

QtNodeEditor/src/NodeGeometry.cpp:82–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80
81
82void
83NodeGeometry::
84recalculateSize() const
85{
86 _entryHeight = _fontMetrics.height();
87
88 {
89 unsigned int maxNumOfEntries = std::max(nSinks(), nSources());
90 unsigned int step = _entryHeight + _spacing;
91 _height = step * maxNumOfEntries;
92 }
93
94 if (auto w = _dataModel->embeddedWidget())
95 {
96 _height = std::max(_height, w->height());
97 }
98
99 _inputPortWidth = portWidth(PortType::In);
100 _outputPortWidth = portWidth(PortType::Out);
101
102 _width = _inputPortWidth +
103 _outputPortWidth +
104 2 * _spacing;
105
106 if (auto w = _dataModel->embeddedWidget())
107 {
108 _width += w->width();
109 }
110
111 if (_dataModel->validationState() != NodeValidationState::Valid)
112 {
113 _width = std::max(_width, (int)validationWidth());
114 _height += validationHeight() + _spacing;
115 }
116}
117
118
119void

Callers

nothing calls this directly

Calls 1

embeddedWidgetMethod · 0.80

Tested by

no test coverage detected