Skip to content

Commit

Permalink
fixup! Adjust top row border and panel sizing to spec
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseDiazRohena committed Apr 17, 2024
1 parent b5225d9 commit 84a7a13
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/gui/panels/ValentineCenterPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@ void CenterPanel::resized()
borderLineThickness = topRowBorder.getHeight() * .01f;
borderCornerSize = topRowBorder.getHeight() * .060f;

const auto topPanelHeight = topRowBorderHeight * .75f;
const auto topPanelY = topRowBorder.getCentreY() - topPanelHeight / 2;
topRow.setBounds (topRowBorder.reduced (juce::roundToInt (margin), 0)
.withY (topPanelY)
.withHeight (topPanelHeight));
const auto getPanelBounds = [] (const juce::Rectangle<int> borderBounds,
const int margin) {
const auto panelHeight = borderBounds.getHeight() * .75f;
const auto panelY = borderBounds.getCentreY() - panelHeight / 2;

return borderBounds.reduced (margin, 0).withY (panelY).withHeight (panelHeight);
};

topRow.setBounds (getPanelBounds (topRowBorder, juce::roundToInt (margin)));

localBounds.removeFromTop (margin);

Expand Down

0 comments on commit 84a7a13

Please sign in to comment.