diff --git a/README.md b/README.md index dc97923e..9a3be8c2 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ npm run build # writes dist/ and regenerates index.html; the folder is wh The browser suite and the three example games need a machine with a GPU: ```bash -node tools/seed-e2e.mjs && node tools/e2e.mjs # the editor, 1209 checks (GM_STEPS=20 for one step) +node tools/seed-e2e.mjs && node tools/e2e.mjs # the editor, 1210 checks (GM_STEPS=20 for one step) # every tool signs in first – see the Accounts page node tools/seed-jumprun.mjs && node tools/smoke-jumprun.mjs node tools/seed-tetris.mjs && node tools/smoke-tetris.mjs diff --git a/src/editor/shader/ShaderEditor.ts b/src/editor/shader/ShaderEditor.ts index e2465177..3edadabe 100644 --- a/src/editor/shader/ShaderEditor.ts +++ b/src/editor/shader/ShaderEditor.ts @@ -185,8 +185,10 @@ export class ShaderEditor extends AssetTabEditor { 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); diff --git a/tools/e2e/28-shader.mjs b/tools/e2e/28-shader.mjs index 494bf340..fc761270 100644 --- a/tools/e2e/28-shader.mjs +++ b/tools/e2e/28-shader.mjs @@ -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({