diff --git a/src/vst/reasampler_editor.cpp b/src/vst/reasampler_editor.cpp index b66a9d4..dfbbc4e 100644 --- a/src/vst/reasampler_editor.cpp +++ b/src/vst/reasampler_editor.cpp @@ -128,8 +128,9 @@ int thumbBins(const BrowserLayout& layout) { ReaSamplerEditor::ReaSamplerEditor(ReaSamplerProcessor* processor) : CPluginView(nullptr), processor_(processor) { - // Default view size — sized to show a couple of card rows + the setup strip. - ViewRect r(0, 0, 560, 400); + // Default view size — 840×560 gives comfortable room for the three-band Sample face + // on a 1080p screen (an interim canvas; Wave 2 tunes final band-height numbers). + ViewRect r(0, 0, 840, 560); setRect(r); } @@ -480,6 +481,21 @@ tresult PLUGIN_API ReaSamplerEditor::canResize() { return kResultTrue; } +tresult PLUGIN_API ReaSamplerEditor::checkSizeConstraint(ViewRect* rect) { + // Enforce a minimum usable floor: at least 560 wide and 380 tall. The host calls this + // before every resize; clamp the proposed rect in place and return kResultTrue so the + // host applies the (possibly adjusted) rect rather than the raw user drag. + // 560×380 keeps the title band + toggle band + a couple of card rows + the setup strip + // visible; anything smaller would clip essential UI. The default 840×560 is above this + // floor — Wave 2 tunes final numbers once the three-band layout is in. + constexpr int kMinW = 560; + constexpr int kMinH = 380; + if (!rect) return kResultFalse; + if (rect->getWidth() < kMinW) rect->right = rect->left + kMinW; + if (rect->getHeight() < kMinH) rect->bottom = rect->top + kMinH; + return kResultTrue; +} + #ifdef _WIN32 void ReaSamplerEditor::invalidate() { diff --git a/src/vst/reasampler_editor.h b/src/vst/reasampler_editor.h index 8f657c4..59f22ab 100644 --- a/src/vst/reasampler_editor.h +++ b/src/vst/reasampler_editor.h @@ -56,6 +56,7 @@ public: Steinberg::tresult PLUGIN_API isPlatformTypeSupported( Steinberg::FIDString type) override; Steinberg::tresult PLUGIN_API canResize() override; + Steinberg::tresult PLUGIN_API checkSizeConstraint(Steinberg::ViewRect* rect) override; protected: void attachedToParent() override;