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:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user