Scope inspector controls and key shape colors

This commit is contained in:
Your Name 2026-10-03 01:48:26 -04:00
parent a834ccb1e2
commit 2697401aad
5 changed files with 159 additions and 42 deletions

View file

@ -226,3 +226,20 @@
(is (= :linear (get-in moved [:channels [:xform :rot] :interp])))
(is (= :hold (get-in visible [:channels [:vis] :interp]))
"boolean parameters do not tween")))
(deftest colour-keys-are-discrete
(let [n {:id :x :kind :poly
:channels {[:style :color] (ch/framed 2)}}
keyed (node/set-keyed-channel n [:style :color] 3 4)
two (node/set-keyed-channel keyed [:style :color] 8 7)]
(is (= :hold (get-in two [:channels [:style :color] :interp]))
"numeric palette slots still hold")
(is (= two (node/set-segment-interp two [:style :color] 3 :linear))
"a caller cannot introduce a colour tween")
(is (= :hold (get-in (node/set-channel
(assoc-in two [:channels [:style :color] :interp] :linear)
[:style :color] 8 6)
[:channels [:style :color] :interp]))
"editing repairs an older tweened colour channel")
(is (= :hold (get-in (node/toggle-key n [:style :color] 3 nil)
[:channels [:style :color] :interp])))))