Drawing in a lane draws into the drawing it shows

With the lane as the target, the brush and the pen made a new cel at the
playhead and cut the one showing there short. What is on screen is what
you are drawing on, so the shape goes into it, as if that cel were
selected; only where the lane shows nothing is a new cel made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011FLuCjp9kNH6ovwJVXSbq9
This commit is contained in:
Olive Vaughn 2026-10-11 00:07:13 -04:00
parent 86f2d96762
commit 1a92a103cc
2 changed files with 40 additions and 17 deletions

View file

@ -370,10 +370,14 @@
(deftest polygon-landing-obeys-the-destination-symbol-mode
(let [lane (fixture/document)
gap (update-in lane [:symbols :main :nodes] dissoc :b)
ordinary (update-in lane [:symbols :main] dissoc :display)
db {:ui {:open :main :selection [:node :main :plate [:plate]]}
:playback {:frame 5}}]
(is (true? (:lane? (ui/polygon-landing lane {} db))))
(is (= {:lane? false :path [:b]} (select-keys (ui/polygon-landing lane {} db) [:lane? :path]))
"a lane draws into the cel it shows at the playhead")
(is (true? (:lane? (ui/polygon-landing gap {} db)))
"and makes a new one only where it shows nothing")
(is (false? (:lane? (ui/polygon-landing ordinary {} db))))))
(deftest beginning-a-polygon-does-not-invent-a-lane
@ -389,18 +393,27 @@
(is (nil? (get-in saved [:symbols :main :display])))
(is (nil? (get-in (store/entry (:clip/current after)) [:history :done])))))
(deftest drawing-with-the-lane-row-active-creates-a-new-cel
(deftest drawing-with-the-lane-row-active-draws-into-what-it-shows
(let [doc (fixture/document)
id (store/install! {:clip doc :store {}} "draw-new-lane-cel")
id (store/install! {:clip doc :store {}} "draw-into-lane-cel")
db {:clip/current id :paint/revision 0
:ui {:open :main :selection [:node :main nil []]}
:playback {:frame 1}}
after (ui/beginning-polygon db)]
(is (= doc (:clip (store/entry id))) "no cel is made over the one showing")
(is (= [] (get-in after [:ui :draft])))))
(deftest drawing-with-the-lane-row-active-in-a-gap-creates-a-new-cel
(let [doc (update-in (fixture/document) [:symbols :main :nodes] dissoc :b)
id (store/install! {:clip doc :store {}} "draw-new-lane-cel")
db {:clip/current id :paint/revision 0
:ui {:open :main :selection [:node :main nil []]}
:playback {:frame 5}}
after (ui/beginning-polygon db)
[_ sid cel-id] (get-in after [:ui :selection])
saved (:clip (store/entry id))]
(is (= :main sid))
(is (not= :a cel-id) "the occupied cel is not reused")
(is (= [1 2] (node/placed-span (get-in saved [:symbols sid :nodes cel-id]))))
(is (= [5 6] (node/placed-span (get-in saved [:symbols sid :nodes cel-id]))))
(is (= 1 (clip/frames saved (node/source (get-in saved [:symbols sid :nodes cel-id])))))
(is (= [] (get-in after [:ui :draft])))))