I need to disable a ComponentBoundsConstrainer size limits (and only size limits, I need on screen amount stay there), so I wrote:
ComponentBoundsConstrainer::setSizeLimits(0, 0…)
However that trigged an assert: jassert (minimumWidth > 0 && minimumHeight > 0);
“setMinimumWidth()” doesnt trig this assert, I know I can disable the minimun size with it, however, why cannot we disable it with setSizeLimits()? Maybe does this need a small fix?
I know it seems it doesnt have sense, but I need resize a component to zero (and doesnt work making it invisible). If you add an assertions to these set funcions, I’m fckd. If you do that, could you please add something like a switch to turn on/off the ComponentBoundsConstrainer effect? Thanks you
I’m using a class that inherits TopLevelWindow in two enviroments. One enviroment is a normal one, where ComponentBoundsConstrainer work as expected. The other enviroment use a custom and complex bounds constrainer with more variables and special rules. And I need when the TopLevelWindow works with the second enviroment it ignores the ComponentBoundsConstrainer.
Of course, I can rewrite a custom ComponentBoundsConstrainer that works on both enviroment, but I was trying to save some time using your CBC.
I can’t think of a circumstance where I’d allow a TopLevelWindow to become so small. You should probably be using a completely different class. E.g. your component could be put inside a TopLevelWindow when it’s on the desktop, and inside something else when it’s not.