Hi, I tried this and it basically works, but as I’m resizing the main window, it jumps around in size quite a bit. is there anything recommended to stop this? thx
I’m not sure what you meant by ‘by scaling’, so sorry if this is not what you meant.
You should only have to scale a parent, and all the children will all scale with it.
My editor is very thin and has a full size child that I scale in resize()
‘backgroundSize’ is the back panel dimensions.
As you can see I set the aspect ratio, because I want my circles to stay circles.
EdtorBase is a child of MyPluginEditor, and holds all of the plug-in’s components.
I apologise if things are in the wrong order for you, but it works.
void MyPlugEditor::resized()
{
auto area = getLocalBounds();
float sc = (float)area.getWidth() / editorBase->backgroundSize.getX();
editorBase->setTransform(AffineTransform::scale(sc));
}
Now I can rescale the plugin and all the children will rescale with it. Which is amazingly useful, as this is only place I scale. Whereas before, I was scaling everything by hand, on each level. This is WAY faster.