Shader preview sliders show again after a property edit (#168)
game-maker / gate (push) Successful in 2m13s
game-maker / suite (push) Successful in 8m1s

Changing min, max or default of a property rebuilt the slider rows of
the shader preview, but the rows stayed at 0 x 0. Only the labels were
visible until the preview was resized by hand.

- Widget.resize only lays out when the size changes. The row count
  stays the same on such an edit, so the row stack kept its height and
  never laid out its new children.
- syncParams now relayouts the row stack itself after the column
  around it.

Tests:
- e2e 28n: a new max rebuilds the slider at 136 x 24, a click at its
  right end sets level 2. Red against the old build (w 0, h 0).
- GM_STEPS=28,31 fresh: ALL PASSED, 106 checks (was 105)
- ./check.sh: 132 files, 1952 tests, exit 0
- Check sum 1210 in README, computed (1209 + 1), CI measures it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5 committed 2026-09-21 09:28:02 +02:00
1 parent 73a71473f1
commit 7063c8d074
3 files changed
+19 -2

No files matched your search

+3 -1
View File
@@ -185,8 +185,10 @@ export class ShaderEditor extends AssetTabEditor<ShaderAsset, GraphCanvas> {
for (const row of this.params.removeChildren()) row.destroy({ children: true });
this.sliders.clear();
for (const def of defs) this.params.add(this.paramRow(def));
// The column keeps its size, so a resize would not reach the rows: the column lays out anew.
// Neither the column nor, with as many rows as before, the stack of rows changes its size,
// and a resize that changes nothing lays nothing out: both lay out anew, outside in.
this.side.relayout();
this.params.relayout();
}
for (const def of defs) {
const row = this.sliders.get(def.key);