Skip to content

Commit

Permalink
squash with top row stuff get the sizing right
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseDiazRohena committed Apr 17, 2024
1 parent 9bd3af4 commit 2bafb50
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/gui/panels/ValentineCenterPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,18 @@ void CenterPanel::resized()
juce::roundToInt (margin * 1.3f));

const auto topRowArea = localBounds.removeFromTop (localBounds.getHeight() * .50f);
const auto topPanelHeight = juce::roundToInt (topRowArea.getHeight() * .88f);
const auto topPanelY = topRowArea.getCentreY() - topPanelHeight / 2;
const auto topRowBorderHeight = juce::roundToInt (topRowArea.getHeight() * .88f);
const auto topRowBorderY = topRowArea.getCentreY() - topRowBorderHeight / 2;

topRowBorder = topRowArea.withY (topPanelY).withHeight (topPanelHeight);
topRowBorder = topRowArea.withY (topRowBorderY).withHeight (topRowBorderHeight);
borderLineThickness = topRowBorder.getHeight() * .005f;
borderCornerSize = topRowBorder.getHeight() * .060f;

topRow.setBounds (topRowBorder.reduced (juce::roundToInt (margin)));
const auto topPanelHeight = topRowBorderHeight * .725f;
const auto topPanelY = topRowBorder.getCentreY() - topPanelHeight / 2;
topRow.setBounds (topRowBorder.reduced (juce::roundToInt (margin), 0)
.withY (topPanelY)
.withHeight (topPanelHeight));

localBounds.removeFromTop (margin);

Expand Down

0 comments on commit 2bafb50

Please sign in to comment.