StretchableLayoutManager bug?


#1

void StretchableLayoutManager::layOutComponents

 

as shown here, should these be "jmin" not "jmax" otherwise it can go off the edge or be bigger than your supplied max size?

 


 if (Component* const c = components[i])
            {
                if (i == numComponents - 1)
                {
                    // if it's the last item, crop it to exactly fit the available space..
                    if (resizeOtherDimension)
                    {
                        if (vertically)
                            c->setBounds (x, pos, w, jmin (layout->currentSize, h - pos));
                        else
                            c->setBounds (pos, y, jmin (layout->currentSize, w - pos), h);
                    }
                    else
                    {
                        if (vertically)
                            c->setBounds (c->getX(), pos, c->getWidth(), jmin (layout->currentSize, h - pos));
                        else
                            c->setBounds (pos, c->getY(), jmin (layout->currentSize, w - pos), c->getHeight());
                    }
                }
                else

#2

No.. I don't think so..

IIRC it works like that because it expands the last item to fill any left-over space. I could be wrong though, it's a long time since I wrote that class!