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

+15
View File
@@ -809,6 +809,21 @@ export async function shader(t) {
written.declared === 1,
{ pulled, dark, written },
);
// A changed range rebuilds the row while the column keeps its height: the new slider still gets
// its width, and its right end is the new max.
await mutate(`
__gm.state.project.assets.find((a) => a.id === ${JSON.stringify(made.id)})
.graph.nodes.find((n) => n.id === 'level').params.max = 2;`);
await sleep(300);
const widened = await json("__gm.shader.sliderAt('level')");
await click(widened.x + widened.w - 2, widened.y + widened.h / 2);
await sleep(300);
const pushed = await json('__gm.shader.preview()');
check(
'a new max rebuilds the slider at full width, and its right end is the new max',
widened.w > 40 && Math.abs(widened.w - levelSlider.w) < 1 && pushed.values.level === 2,
{ levelSlider, widened, pushed },
);
await assetProps({ texture: picture?.id ?? '', color: 0xffffff, shader: made.id, level: 0.5 });
const onSprite = await openPreview({