| 80 | |
| 81 | |
| 82 | void |
| 83 | NodeGeometry:: |
| 84 | recalculateSize() 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 | |
| 119 | void |
nothing calls this directly
no test coverage detected