Fix deck-UI review findings: right-anchor MASTER's meter column, correct stale/overclaiming comments, split test_deck_groups.cpp on its commit-tier/overlay seam, and pin two width-ceiling assertions.
This commit is contained in:
@@ -8,8 +8,8 @@ namespace reasampler::instrument::ui {
|
||||
|
||||
namespace {
|
||||
|
||||
// The knob-row width of a group: cells side by side (no inter-cell gap — the 48px cell
|
||||
// already carries its own breathing room around the 28px knob), plus the optional row
|
||||
// The knob-row width of a group: cells side by side (no inter-cell gap — the 60px cell
|
||||
// already carries its own breathing room around the 40px knob), plus the optional row
|
||||
// toggle after a kDeckToggleGap. A spanning group's cells stack, so its knob row is one
|
||||
// cell wide plus whatever readout column sits beside it.
|
||||
int knobRowWidth(const DeckGroupDesc& g) {
|
||||
@@ -109,8 +109,10 @@ DeckGroupLayout layoutGroup(const DeckGroupDesc& g, const Rect& box) {
|
||||
slotTop += kDeckGroupH + kDeckRowGap;
|
||||
}
|
||||
if (g.column.id >= 0) {
|
||||
// ONE rect spanning every slot, not a readout per row.
|
||||
const int colX = innerLeft + (g.cellIds.empty() ? 0 : kDeckCellW + kDeckColumnGap);
|
||||
// ONE rect spanning every slot, not a readout per row. Right-anchored off
|
||||
// innerRight rather than measured past the cell slot, so a wider caption
|
||||
// reserve on this group can never detach the column from the padding.
|
||||
const int colX = innerRight - g.column.width;
|
||||
out.column = DeckColumnLayout{
|
||||
g.column.id, Rect::ltrb(colX, cellTop, colX + g.column.width,
|
||||
box.bottom() - kDeckGroupPadY)};
|
||||
@@ -156,7 +158,7 @@ std::vector<int> justifyGutters(int count, int total, int blockW) {
|
||||
const int slack = blockW - total;
|
||||
if (slack < gutters * kDeckGroupGap) {
|
||||
// The block cannot hold the row: minimum gutters, and the row overruns to the right
|
||||
// rather than wrapping. Unreachable in the editor — see layoutDeck's header note.
|
||||
// rather than wrapping — see layoutDeck's header note for when this degrade applies.
|
||||
return std::vector<int>(static_cast<std::size_t>(gutters), kDeckGroupGap);
|
||||
}
|
||||
const int base = slack / gutters;
|
||||
|
||||
Reference in New Issue
Block a user