File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,13 @@ void DefaultVerticalNodeGeometry::recomputeSize(NodeId const nodeId) const
5454 unsigned int inPortWidth = maxPortsTextAdvance (nodeId, PortType::In);
5555 unsigned int outPortWidth = maxPortsTextAdvance (nodeId, PortType::Out);
5656
57- unsigned int width = std::max (inPortWidth * nInPorts + _portSpasing * (nInPorts - 1 ),
58- outPortWidth * nOutPorts + _portSpasing * (nOutPorts - 1 ));
57+ unsigned int totalInPortsWidth =
58+ nInPorts > 0 ? inPortWidth * nInPorts + _portSpasing * (nInPorts - 1 ) : 0 ;
59+
60+ unsigned int totalOutPortsWidth =
61+ nOutPorts > 0 ? outPortWidth * nOutPorts + _portSpasing * (nOutPorts - 1 ) : 0 ;
62+
63+ unsigned int width = std::max (totalInPortsWidth, totalOutPortsWidth);
5964
6065 if (auto w = _graphModel.nodeData <QWidget *>(nodeId, NodeRole::Widget)) {
6166 width = std::max (width, static_cast <unsigned int >(w->width ()));
You can’t perform that action at this time.
0 commit comments