mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-25 02:27:00 -06:00
Cause: puppet::solve binds each moving pin to its nearest mesh vertex and fixes that vertex at position + (vertex - rest), an offset in rest space with no rotation or scale. puppet.addPin set a new pin's position to the click, so in a bent region the bound vertex was pulled to where it would be unrotated, and the mesh jumped as soon as the pin was added. Fix: addPin picks the position that keeps the bound vertex at its current deformed place: the vertex's deformed position minus the rest offset. On an unbent mesh that is the click itself (round-off is snapped back to it), so existing pins behave as before. Test: a_pin_added_to_a_bent_mesh_moves_nothing (two pins, one moved to bend the layer, then pins added at three places on the bent part: at most a few edge pixels change from solver round-off; before the fix about 250 did). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiAJeFttZp83Fh7YuzAR5f (cherry picked from commit 16151203b304d565b425873fdd33ae082cae483b)