From 6fdab5e0c2a83ad3f002ef7a8a433260495388ba Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Mon, 15 Apr 2024 06:23:39 +0200 Subject: [PATCH] undo problematic commit --- core/src/gui/widgets/waterfall.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/core/src/gui/widgets/waterfall.cpp b/core/src/gui/widgets/waterfall.cpp index 8126ee6d..f2556905 100644 --- a/core/src/gui/widgets/waterfall.cpp +++ b/core/src/gui/widgets/waterfall.cpp @@ -717,23 +717,18 @@ namespace ImGui { void WaterFall::onResize() { std::lock_guard lck(latestFFTMtx); std::lock_guard lck2(smoothingBufMtx); + // return if widget is too small + if (widgetSize.x < 100 || widgetSize.y < 100) { + return; + } - // Check if the size is valid. This is because some settings might be changed before being first displayed. - if (widgetSize.x < 1.0f || widgetSize.y < 1.0f) { return; } - - // Set a minimim size - widgetSize.x = std::max(widgetSize.x, 100.0f*style::uiScale); - widgetSize.y = std::max(widgetSize.y, 100.0f*style::uiScale); - - // Save last height int lastWaterfallHeight = waterfallHeight; - // Compute sizes if (waterfallVisible) { FFTAreaHeight = std::min(FFTAreaHeight, widgetSize.y - (50.0f * style::uiScale)); newFFTAreaHeight = FFTAreaHeight; fftHeight = FFTAreaHeight - (50.0f * style::uiScale); - waterfallHeight = std::max(1, widgetSize.y - fftHeight - (50.0f * style::uiScale) - 2); + waterfallHeight = widgetSize.y - fftHeight - (50.0f * style::uiScale) - 2; } else { fftHeight = widgetSize.y - (50.0f * style::uiScale);