diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-03-05 16:53:15 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2025-03-05 16:53:15 +0100 |
commit | dd9fd17e59155ca05f93c9ec1d48430041f648bd (patch) | |
tree | 28a4040349d428a5b44d8e7d5620154c06cc42ce | |
parent | f6660bc51fe8c02ff7c3b6188e8437c67712bddf (diff) |
Fix crash when resizing window below certain threshold (seen in Reaper).
-rw-r--r-- | plugingui/resamplingframecontent.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugingui/resamplingframecontent.cc b/plugingui/resamplingframecontent.cc index d92dc27..6e631c7 100644 --- a/plugingui/resamplingframecontent.cc +++ b/plugingui/resamplingframecontent.cc @@ -30,6 +30,8 @@ #include <translation.h> +#include <algorithm> + namespace GUI { @@ -70,9 +72,9 @@ ResamplingframeContent::ResamplingframeContent(dggui::Widget* parent, void ResamplingframeContent::resize(std::size_t width, std::size_t height) { Widget::resize(width, height); - text_field.resize(width - 50, height); - quality_knob.move(width - 36, 20); - quality_label.move(width - 40, 0); + text_field.resize(std::max(width, std::size_t{51}) - 50, height); + quality_knob.move(std::max(width, std::size_t{37}) - 36, 20); + quality_label.move(std::max(width, std::size_t{41}) - 40, 0); } void ResamplingframeContent::updateContent() |