Preview and padlock: two leftovers after the first pass

- A node dragged taller while its preview was off keeps that height when
  the preview comes back.
- A new picture with no ratio lit starts with the padlock off, as the
  untouched picture has no shape to hold.
This commit is contained in:
ausboss
2026-09-29 21:40:23 -05:00
parent 40571ce86b
commit 5b2f2508ab
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -275,7 +275,7 @@ function syncPreviewMode(state, resize) {
// On: back to the height it had, with the last result in it.
const before = Number(node.properties[HEIGHT_PROPERTY]);
delete node.properties[HEIGHT_PROPERTY];
const height = Math.max(floor, Number.isFinite(before) ? before : 0);
const height = Math.max(floor, Number.isFinite(before) ? before : 0, Number(node.size?.[1]) || 0);
node.setSize?.([node.size?.[0] ?? PANEL_MIN_WIDTH, height]);
}
node.setDirtyCanvas?.(true, true);
+3
View File
@@ -1242,6 +1242,9 @@ function refitAspect(state) {
state.refitTo = null;
if (aspect) fitAspect(state, aspect, aspectMode(state));
else if (state.node.properties) delete state.node.properties.ausboss_fit_aspect;
// A new picture with no ratio lit is back to Source: a lock left from the
// old one would hold nothing.
settleRequest(state);
}
async function loadSource(state) {