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

@ -555,7 +555,9 @@
of the symbol plays on `frame` of `host`, which is what dragging something onto
a playhead is asking for. Its `:span` is in its OWN frames — the whole symbol,
0 to its length at `speed` — wherever it was dropped; see `node/placed-span`.
`speed` is 1 unless the symbol's frames are footage's at another rate.
`speed` is 1 unless the symbol's frames are footage's at another rate, and 0
for a held cel, which shows its symbol's first frame and so starts one frame
long, as `span/held` does.
Refused, returning the clip unchanged, when it would make a cycle: a symbol
cannot be placed inside itself or inside anything it places."
@ -575,7 +577,7 @@
;; Lexicographic draw order, as `domain/paint` does it: an instance made
;; later sits above one made earlier, and neither has to renumber.
:z (str "z" (js/Date.now) "-" (name sid))
:span [0 (js/Math.ceil (/ (:frames target) speed))]
:span [0 (if (pos? speed) (js/Math.ceil (/ (:frames target) speed)) 1)]
:time {:mode :map :at frame :rate 1}
:source {:symbol sid}
:playback {:in 0 :speed speed :end :stop}

View file

@ -883,7 +883,13 @@
seeded (assoc-in document [:symbols sid] new-symbol)]
(span/place-symbol seeded st host instance-id sid at
{:extent :grow-symbol
:remainder-id (random-uuid)})))]
:remainder-id (random-uuid)
;; Held like a drawing cel, so
;; stretching it shows what is drawn
;; in it across the whole cel.
:speed (if (and (= :lane destination-kind)
(not lane?))
0 1)})))]
(if-let [why (:refused result)]
(update db :project merge {:status why})
(let [selection [:node host instance-id (conj (vec down) instance-id)]]
@ -1026,7 +1032,7 @@
(rf/reg-event-db
::new-symbol-at
;; ONE GESTURE AND ONE CREATION PATH FOR EVERY LANE. Empty space in a lane
;; takes a new one-frame symbol at the frame double-clicked -- the pointer
;; takes a new one-frame held symbol at the frame double-clicked -- the pointer
;; names a place in time as well as a lane, which is the whole of the gesture
;; and the reason it is not the playhead's. The DESTINATION decides what is
;; created there: a clip of a palette track is a palette symbol whose
@ -1047,7 +1053,8 @@
palette? (assoc :type :palette)))
result (span/place-symbol seeded st (:sid where) uuid sid (:at where)
{:extent :grow-symbol
:remainder-id (random-uuid)})
:remainder-id (random-uuid)
:speed 0})
result (if-let [placed (and palette? (:clip result))]
(assoc result :clip
(assoc-in placed [:symbols (:sid where) :nodes uuid