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.
MyPlugEditor::MyPlugEditor(MyPlugAudioProcessor& p) : AudioProcessorEditor (&p), processor (p)
editorBase = std::make_unique<EditorBase>(p);
editorBase->setBounds(0, 0, editorBase->backgroundSize.getX(), editorBase->backgroundSize.getY());
// Aspect ratio stuff...
sizeRatio = (float)editorBase->backgroundSize.getX() / (float)(editorBase->backgroundSize.getY());
// Set this parent's size...
setSize(backgroundSize.getX() / 2, backgroundSize.getY() / 2);
setResizeLimits(256, 256, editorBase->backgroundSize.getX() , editorBase->backgroundSize.getY());
And resize does just this:
auto area = getLocalBounds();
float sc = (float)area.getWidth() / editorBase->backgroundSize.getX();
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.