Unify lane overlap and nested timing
This commit is contained in:
parent
1b2b4ad3d2
commit
8f09b7b47f
6 changed files with 140 additions and 86 deletions
|
|
@ -356,3 +356,15 @@
|
|||
(is (= [22 23] (node/placed-span (get-in slid [:symbols :lane :nodes :b]))))
|
||||
(is (= 1 (:rate (get-in slid [:symbols :lane :nodes :b :time])))
|
||||
"and the rest of its map is still there")))
|
||||
|
||||
(deftest sliding-in-a-lane-claims-overlapped-time
|
||||
;; The gesture is `nest/slide` in both display modes. Lane mode contributes
|
||||
;; only the placement rule at commit: the moved cel replaces what it covers.
|
||||
(let [c (on-twos)
|
||||
r (nest/slide c :lane [:b] -14)
|
||||
slid (:clip r)]
|
||||
(is (nil? (:refused r)) (:refused r))
|
||||
(is (= [5 6] (node/placed-span (get-in slid [:symbols :lane :nodes :b]))))
|
||||
(is (nil? (get-in slid [:symbols :lane :nodes :a]))
|
||||
"a fully covered neighbor is removed")
|
||||
(is (empty? (clip/problems slid)))))
|
||||
|
|
|
|||
|
|
@ -63,6 +63,29 @@
|
|||
[:node :main :insert [:insert]]]
|
||||
(mapv :select (:cels lane))))))
|
||||
|
||||
(deftest a-nested-lane-is-drawn-in-the-open-symbols-frame-rate
|
||||
(let [child {:id :cel :kind :instance :z "a" :span [0 2]
|
||||
:time {:at 4 :rate 1}
|
||||
:source {:symbol :drawing}
|
||||
:playback {:in 0 :speed 0 :end :stop}}
|
||||
placed {:id :take :kind :instance :z "a" :span [0 12]
|
||||
:time {:at 0 :rate 1}
|
||||
:source {:symbol :lane}
|
||||
:playback {:in 0 :speed 1 :end :stop}}
|
||||
doc (-> (clip/blank)
|
||||
(assoc :fps 12)
|
||||
(assoc-in [:symbols :main :fps] 12)
|
||||
(assoc-in [:symbols :main :frames] 12)
|
||||
(assoc-in [:symbols :main :nodes] {:take placed})
|
||||
(assoc-in [:symbols :lane]
|
||||
{:id :lane :fps 24 :frames 24 :display :lane
|
||||
:nodes {:cel child}})
|
||||
(assoc-in [:symbols :drawing]
|
||||
{:id :drawing :fps 24 :frames 1 :nodes {}}))
|
||||
lane (first (filter :lane? (timeline/rows doc :main #{})))]
|
||||
(is (= [[2 3]] (mapv :span (:cels lane)))
|
||||
"native frames 4–6 occupy ruler frames 2–3 at twice the frame rate")))
|
||||
|
||||
(deftest an-ordinary-symbol-keeps-a-row-per-node
|
||||
(let [doc (update-in (fixture/document) [:symbols :main] dissoc :display)
|
||||
rows (timeline/rows doc :main #{})]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue