From 817177e6200e0e45eaff78db1bd5cd63c8988cd8 Mon Sep 17 00:00:00 2001 From: James H Ball Date: Wed, 8 Jan 2025 21:39:40 +0000 Subject: [PATCH] Set minimum size for the visualiser to prevent issues --- Source/MainComponent.cpp | 3 +++ Source/SosciPluginEditor.cpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/Source/MainComponent.cpp b/Source/MainComponent.cpp index c61aba3..ce4a34d 100644 --- a/Source/MainComponent.cpp +++ b/Source/MainComponent.cpp @@ -229,6 +229,9 @@ void MainComponent::resized() { auto shiftedBounds = bounds; shiftedBounds.setX(topLeft.getX()); shiftedBounds.setY(topLeft.getY()); + if (minDim < 35) { + minDim = 35; + } pluginEditor.visualiser.setBounds(shiftedBounds.withSizeKeepingCentre(minDim - 25, minDim)); } } diff --git a/Source/SosciPluginEditor.cpp b/Source/SosciPluginEditor.cpp index f516ee8..49b5743 100644 --- a/Source/SosciPluginEditor.cpp +++ b/Source/SosciPluginEditor.cpp @@ -50,6 +50,12 @@ void SosciPluginEditor::resized() { visualiserSettings.setSize(settingsArea.getWidth(), 550); visualiserSettingsWrapper.setBounds(settingsArea); + if (area.getWidth() < 10) { + area.setWidth(10); + } + if (area.getHeight() < 10) { + area.setHeight(10); + } visualiser.setBounds(area); } }