Hold a new cel in a lane, so stretching it shows what is drawn in it

A double-clicked or newly created cel in a lane was a one-frame symbol
playing at speed 1 and stopping at its end, so dragging its edge out left
every frame past the first empty. It is now held at speed 0, as a drawing
cel already is: the two are the same lane-creation operation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Olive Vaughn 2026-10-10 19:45:38 -04:00
parent cd02eb0477
commit 641f1fa18c
3 changed files with 28 additions and 5 deletions

View file

@ -879,3 +879,17 @@
(is (= 10 (get-in result [:clip :symbols :main :nodes :insert :time :at])))
(is (= (get-in doc [:symbols :wave :nodes])
(get-in result [:clip :symbols :wave :nodes])))))
(deftest a-held-placement-shows-its-first-frame-for-as-long-as-it-lasts
(let [lane (-> (document)
(assoc-in [:symbols :main] {:id :main :frames 40 :display :lane :nodes {}})
(assoc-in [:symbols :blank] {:id :blank :frames 1 :nodes {}}))
placed (:clip (span/place-symbol lane nil :main :cel :blank 0
{:extent :grow-symbol :remainder-id :r :speed 0}))
stretched (:clip (span/resize-out placed :main :cel 6 {:extent :grow-symbol}))
n (get-in stretched [:symbols :main :nodes :cel])]
(is (= [0 1] (node/placed-span (get-in placed [:symbols :main :nodes :cel])))
"a held cel starts one frame long rather than its symbol's length over zero")
(is (= [0 6] (node/placed-span n)))
(is (every? #(= {:symbol :blank :frame 0} (node/placed-frame n % 1)) (range 6))
"stretched, every frame of it shows the one drawing")))