Rewiring a dragged link (Disconnect + Connect), dragging a frame (Edit
frame + Move nodes) and Import bitmap (import + add node + set param)
each made 2-3 history entries. Add Session::begin_group/end_group and
Session::group: edits inside a group share one snapshot, an untouched
group records nothing, and a failing group() restores everything. The
UI uses begin/end_group around those gestures.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The multigrid solve divided the slope divergence by the level's scale where it
must multiply (one coarse pixel spans `scale` full-size pixels), so the coarse
levels contributed almost nothing and the broad shape was lost. A Gaussian bump
round-tripped through Height to Normal now correlates 0.99+ at 256 and 1024 px
(0.86 at 256 before).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
resolve_params only checked types, so a hand-edited file, a binding to an
exposed input or a dynamic function could pass any float or int to a cook
(including NaN and 1e30). Clamp Float, Int and Float2 parameters to the
declared min/max in resolve_params (new clamp_params; non-finite values fall
back to the default; angles are left alone) and again in eval after bindings
and functions have run.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
decode() decoded the whole image before checking its size, so an oversized
image allocated first and was refused after. The dimensions are now read from
the header and refused before decoding, and the decoder gets width and height
limits. write_atomic syncs the temp file before the rename and uses a
per-process, per-call temp name so concurrent saves of one path do not collide.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
File > Open, Close all, Empty package, drag-drop and browser open, and
closing the window or Quit replaced or ended the package without
checking Session::modified. They now hold the action and show a Save /
Discard / Cancel dialog; a failed or cancelled save keeps the work. The
decision is a pure state machine (unsaved.rs) and the held action is
serde state in Windows::unsaved. Engine commands run by the control
channel, MCP and CLI still never open a dialog.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Each used one noise period for both axes while the cell counts differed per
axis, leaving a seam. Add noise::value_xy (separate period per axis) and use
whole-number cell counts. The noises_tile test now checks the top/bottom edge
too, compares against the mean neighbour difference, and covers the three nodes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ui.set replaced whole top-level keys, so a partial {"prefs":{"thumbnails":false}}
reset every other preference to its default. It now merges objects
recursively. GraphCamera and ImageCamera gain sanitized(), applied after
ui.set and when drawing, so a zoom of 0 or NaN can no longer reach the
division in view_center and the 2D view.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Out-of-range indices were filtered one at a time, which shifted every later
triangle (and a glTF index count that was not a multiple of 3 shifted later
primitives). Importers now keep or drop whole triangles. Non-finite positions,
normals and UVs are rejected before normals, tangents and bounds are computed
from them; a NaN position used to hang the import.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>