idk man something hopefully helpful

This commit is contained in:
Your Name 2026-10-03 04:48:03 -04:00
parent 5b5b9ae4c3
commit 551d572347
2 changed files with 14 additions and 1 deletions

View file

@ -5,7 +5,9 @@
Cheap by construction, like `subs/playback`: each reads a path and returns a Cheap by construction, like `subs/playback`: each reads a path and returns a
value, so clicking a swatch notifies the swatches and nothing else." value, so clicking a swatch notifies the swatches and nothing else."
(:require [arthur.domain.creation :as creation] (:require [arthur.domain.creation :as creation]
[arthur.domain.clip :as clip]
[arthur.domain.nest :as nest] [arthur.domain.nest :as nest]
[arthur.domain.node :as node]
[arthur.domain.pick :as pick] [arthur.domain.pick :as pick]
[arthur.footage.store :as store] [arthur.footage.store :as store]
[arthur.subs.playback :as playback] [arthur.subs.playback :as playback]
@ -93,7 +95,15 @@
(when-let [{:keys [sid id frame] :as pl} (nest/placement clip st open path f)] (when-let [{:keys [sid id frame] :as pl} (nest/placement clip st open path f)]
(let [n (get-in clip [:symbols sid :nodes id])] (let [n (get-in clip [:symbols sid :nodes id])]
(assoc pl :node n (assoc pl :node n
:bounds ((pick/bounds-of clip st sid n) frame)))))))) ;; An explicitly created symbol can be empty. It is still a
;; valid creation destination, so give its occurrence a
;; visible target box using the source symbol's stage until
;; content supplies tighter bounds. Drawing-created symbols
;; already take the normal content-bounds branch.
:bounds (or ((pick/bounds-of clip st sid n) frame)
(when-let [source (node/source n)]
(let [[w h] (clip/stage clip source)]
[0 0 w h]))))))))))
(rf/reg-sub (rf/reg-sub
::selected-placement ::selected-placement

View file

@ -64,6 +64,9 @@
(is (= :main sid)) (is (= :main sid))
(is (= [5 6] (node/placed-span instance))) (is (= [5 6] (node/placed-span instance)))
(is (= 1 (clip/frames saved source))) (is (= 1 (clip/frames saved source)))
(is (= source (:sid (creation/target saved {} :main
(get-in db [:ui :selection]) 5)))
"an explicitly created cel is immediately its own creation target")
(is (every? (fn [other] (is (every? (fn [other]
(or (= instance-id (:id other)) (or (= instance-id (:id other))
(let [[a b] (node/placed-span other)] (let [[a b] (node/placed-span other)]