From 5963661e26b1fecec6092d9d8d9890355a48fbb1 Mon Sep 17 00:00:00 2001 From: Jose Diaz Rohena Date: Wed, 3 Jan 2024 20:59:21 +0100 Subject: [PATCH] Move border variable initialisations to a better place --- src/gui/panels/ValentineCenterPanel.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/panels/ValentineCenterPanel.cpp b/src/gui/panels/ValentineCenterPanel.cpp index 2370846a..4dbe4163 100644 --- a/src/gui/panels/ValentineCenterPanel.cpp +++ b/src/gui/panels/ValentineCenterPanel.cpp @@ -101,6 +101,11 @@ void CenterPanel::resized() const auto topRowHeight = localBounds.getHeight() * .50f; topRowBorder = localBounds.removeFromTop (juce::roundToInt (topRowHeight)); + + const auto topRowBorderHeight = topRowBorder.getHeight(); + borderLineThickness = topRowBorderHeight * .01f; + borderCornerSize = topRowBorderHeight * .060f; + auto topRowComponents = topRowBorder.reduced (juce::roundToInt (margin)); auto topRowSliders = topRowComponents.removeFromLeft ( @@ -163,10 +168,6 @@ void CenterPanel::resized() juce::RectanglePlacement (juce::RectanglePlacement::centred | juce::RectanglePlacement::fillDestination)); - const auto topRowBorderHeight = topRowBorder.getHeight(); - borderLineThickness = topRowBorderHeight * .01f; - borderCornerSize = topRowBorderHeight * .060f; - localBounds.removeFromTop (juce::roundToInt (margin * 2)); bottomRowBorder = localBounds;