mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-26 11:09:23 -06:00
The panel drew the Effective curve with its own copy of the region formula, which omitted the running maximum `lightcraft_pipeline::finish::curve_luts` uses to keep the curve monotone. With neighbouring regions pushed opposite ways the drawn line folded back into a dip the renderer never produced, so the graph and the four sliders under it disagreed. `ParametricCurve` is now the one curve both use: the region bumps summed and then forced monotone, sampled at the renderer's resolution. The graph asks it every frame and holds no state of its own, so a slider moved by hand, Reset and Undo all redraw the line from the settings in the frame they change — the two can no longer be left showing different things. Reset and the undo step were already atomic (the whole Tone Curve is one `develop` state, and a drag is one engine interaction); tests now pin that the painted line, not just the settings, follows Reset and Undo. Tests: the folded shape proves the bare sum is not monotone while the model is; the painted path is compared point-by-point against the model; Reset clears the four sliders and the graph together; one undo takes back a whole drag. Co-Authored-By: deepseek-flash <noreply@deepseek.com>