Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting plugin editor scale factor (and other plugin editor changes) #134

Merged
merged 9 commits into from
Sep 19, 2023
5 changes: 5 additions & 0 deletions examples/GainPlugin/PluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ PluginEditor::PluginEditor(GainPlugin &plug) : juce::AudioProcessorEditor(plug),
plugin.getValueTreeState().addParameterListener(gainParameter->paramID, this);

setSize(300, 300);
setResizable (true, true);

constrainer.setSizeLimits (200, 200, 500, 500);
constrainer.setFixedAspectRatio (1.0);
setConstrainer (&constrainer);
}

PluginEditor::~PluginEditor()
Expand Down
2 changes: 2 additions & 0 deletions examples/GainPlugin/PluginEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ class PluginEditor : public juce::AudioProcessorEditor,
std::unique_ptr<juce::Slider> gainSlider;
std::unique_ptr<juce::SliderParameterAttachment> sliderAttachment;

juce::ComponentBoundsConstrainer constrainer;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginEditor)
};
Loading
Loading