New empty symbol, nested in the selected instance or the open symbol
'+ symbol' in the timeline makes an empty symbol and places it at the playhead: inside the selected instance, beside any other selected node, or in the open symbol. Timeline selections carry their row path so a symbol placed twice nests into the row that was clicked. Symbols gain a :name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5dff490162
commit
2d2eb0fc9f
6 changed files with 114 additions and 14 deletions
|
|
@ -234,3 +234,26 @@
|
|||
(is (empty? (clip/problems c)))
|
||||
(is (= (get-in c [:symbols :outer :nodes])
|
||||
(get-in (leaf/clip "c" (leaf/leaves "c" c)) [:symbols :outer :nodes]))))))
|
||||
|
||||
(deftest a-new-symbol-is-empty-and-placed-where-it-was-asked-for
|
||||
(let [c (nested)
|
||||
u #uuid "00000000-0000-4000-8000-000000000001"
|
||||
id (clip/fresh-id c)
|
||||
made (clip/new-symbol c :outer id 20 u)]
|
||||
(is (= :symbol-1 id))
|
||||
(is (= :symbol-2 (clip/fresh-id made)) "the next one does not collide")
|
||||
(is (= {:id :symbol-1 :name "symbol-1" :frames 180 :nodes {}}
|
||||
(clip/symbol made :symbol-1))
|
||||
"empty, and as long as the rest of what it was placed in")
|
||||
(is (= {:of :symbol-1 :span [20 200] :time {:mode :map :at 20 :in 0 :rate 1}}
|
||||
(select-keys (get-in made [:symbols :outer :nodes u]) [:of :span :time])))
|
||||
(is (empty? (clip/problems made)))
|
||||
(is (= c (clip/new-symbol c :outer :inner 0 u)) "an id already in use is refused")
|
||||
(is (= c (clip/new-symbol c :outer id 200 u)) "past the end is refused")))
|
||||
|
||||
(deftest a-frame-is-carried-down-through-the-instances-a-row-path-names
|
||||
(let [c (nested)
|
||||
[id] (keys (get-in c [:symbols :outer :nodes]))]
|
||||
(is (= [:outer 12] (clip/frame-inside c :outer [] 12)))
|
||||
(is (= [:inner 7] (clip/frame-inside c :outer [id] 12))
|
||||
"the instance starts at 5, so frame 12 outside is frame 7 inside")))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue