paceholder / nodeeditor

Qt Node Editor. Dataflow programming framework
BSD 3-Clause "New" or "Revised" License
2.92k stars 795 forks source link

Vertical mode width error #365

Closed ren062 closed 1 year ago

ren062 commented 1 year ago

void DefaultVerticalNodeGeometry::recomputeSize(NodeId const nodeId) const

unsigned int width = std::max(inPortWidth nInPorts + _portSpasing (nInPorts - 1), outPortWidth nOutPorts + _portSpasing (nOutPorts - 1));

when nInPorts = 0 or nOutPorts = 0 width error

i change below:

unsigned int nTotolInPortWidth = 0;
if (nInPorts != 0)
{
    nTotolInPortWidth = inPortWidth * nInPorts + _portSpasing * (nInPorts - 1);
}

unsigned int nTotolOutPortWidth = 0;
if (nOutPorts != 0) 
{
    nTotolOutPortWidth = outPortWidth * nOutPorts + _portSpasing * (nOutPorts - 1);
}

unsigned int width = std::max(nTotolInPortWidth, nTotolOutPortWidth);
paceholder commented 1 year ago

I fixed that, thanks for reporting.