Group tracing layers in the pool and fit new drops to the stage
This commit is contained in:
parent
f4dd047642
commit
1ae49a4015
3 changed files with 58 additions and 25 deletions
|
|
@ -205,6 +205,30 @@
|
|||
(is (= 1 (count (filter clip/trace? (vals (:symbols doc2))))))))))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
(deftest dropping-a-tracing-symbol-fits-only-the-new-placement
|
||||
(doseq [point [nil [80 60]]]
|
||||
(let [c (traced nil)
|
||||
plate (get-in c [:symbols :face-1 :nodes :plate])
|
||||
sid (node/source plate)
|
||||
c (assoc-in c [:symbols sid :width] 3000)
|
||||
id (store/install! {:clip c :store (:store @frozen)} "fit-pool-tracing")]
|
||||
(reset! rf-db/app-db {:clip/current id :paint/revision 0
|
||||
:ui {:open :main} :playback {:frame 0}})
|
||||
(rf/dispatch-sync [::ui/drop-symbol sid 0 point nil])
|
||||
(let [doc (:clip (store/entry id))
|
||||
[_ host uuid] (get-in @rf-db/app-db [:ui :selection])
|
||||
n (get-in doc [:symbols host :nodes uuid])
|
||||
[w h] (clip/stage doc host)
|
||||
k (min (/ w 3000) (/ h image-h))]
|
||||
(is (= [k k] (get-in n [:channels [:xform :scale] :value])))
|
||||
(is (= (or point [(/ w 2) (/ h 2)])
|
||||
(mapv + (get-in n [:channels [:xform :pos] :value])
|
||||
(get-in n [:channels [:xform :anchor] :value]))))
|
||||
(is (= plate (get-in doc [:symbols :face-1 :nodes :plate]))
|
||||
"the face's registered tracing placement is unchanged")
|
||||
(is (= (clip/symbol c sid) (clip/symbol doc sid))
|
||||
"the shared tracing symbol is unchanged")))))
|
||||
|
||||
;; on and off
|
||||
|
||||
(deftest switching-one-layer-on-switches-tracing-on
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue