and I get code exceptions. e.g. these assert failures:
void ResizableWindow::childBoundsChanged (Component* child)
{
if ((child == contentComponent) && (child != nullptr) && resizeToFitContent)
{
// not going to look very good if this component has a zero size..
jassert (child->getWidth() > 0);
jassert (child->getHeight() > 0);
auto borders = getContentComponentBorder();
setSize (child->getWidth() + borders.getLeftAndRight(),
child->getHeight() + borders.getTopAndBottom());
}
}
I can stretch it back to shape, but how can I prevent it?
Looks like “Height” and “Width” of the Root View are important (I added as shown below and now I can set the size of the panel). If these are not set it looks like min-height and min-width don’t do anything.
<?xml version="1.0" encoding="UTF-8"?>
<magic>
<Styles>
<Style name="default">
<Nodes/>
<Classes>
<plot-view border="2" background-color="black" border-color="silver" display="contents"/>
<nomargin margin="0" padding="0" border="3"/>
<group margin="5" padding="5" border="2" flex-direction="column"/>
</Classes>
<Types>
<Slider slider-type="rotary" border="3" slider-textbox="textbox-below"
lookAndFeel="Skeuomorphic" flex-align-self="auto" caption-size="20"
slider-track="FFDC3B3B" rotary-outline="FF1E91CF" rotary-fill="FFD2BD2A"/>
<ToggleButton border="0" max-height="50" caption-size="0" text="Active"/>
<TextButton border="0" max-height="50" caption-size="0"/>
<ComboBox border="0" max-height="50" caption-size="0"/>
<Plot border="0" margin="0" padding="0" background-color="00000000"
radius="0"/>
<XYDragComponent border="0" margin="0" padding="0" background-color="00000000"
radius="0"/>
</Types>
<Palettes>
<default/>
</Palettes>
</Style>
</Styles>
<View id="root" background-color="FF000500" background-image="photos_2015_09_18_fst_357aoopbiym_jpg"
image-placement="fill" border="5" border-color="FF83110E" background-alpha="0.2"
flex-justify-content="space-around" flex-align-items="stretch"
flex-align-content="start" display="flexbox" flex-align-self=""
resizable="0" width="50" height="100" max-height="500" max-width="900"
min-width="800" min-height="400" flex-grow="1" resize-corner="1"/>
</magic>
It’s not so surprising. Maybe the question is why doesn’t it do this when binary content is not enabled?