mirror of
https://github.com/penpot/penpot.git
synced 2025-05-19 11:26:12 +02:00
📎 Allow to debug touched attibute
This commit is contained in:
parent
e26ba1fabd
commit
d5e70e51ba
1 changed files with 48 additions and 42 deletions
|
@ -76,7 +76,9 @@
|
||||||
(let [page-id (get @state :current-page-id)]
|
(let [page-id (get @state :current-page-id)]
|
||||||
(logjs "state" (get-in @state [:workspace-data :pages-index page-id :objects]))))
|
(logjs "state" (get-in @state [:workspace-data :pages-index page-id :objects]))))
|
||||||
|
|
||||||
(defn ^:export dump-tree []
|
(defn ^:export dump-tree
|
||||||
|
([] (dump-tree false))
|
||||||
|
([show-touched]
|
||||||
(let [page-id (get @state :current-page-id)
|
(let [page-id (get @state :current-page-id)
|
||||||
objects (get-in @state [:workspace-data :pages-index page-id :objects])
|
objects (get-in @state [:workspace-data :pages-index page-id :objects])
|
||||||
components (get-in @state [:workspace-data :components])
|
components (get-in @state [:workspace-data :components])
|
||||||
|
@ -90,6 +92,10 @@
|
||||||
{:length 20
|
{:length 20
|
||||||
:type :right})
|
:type :right})
|
||||||
(show-component shape objects))
|
(show-component shape objects))
|
||||||
|
(when (and show-touched (seq (:touched shape)))
|
||||||
|
(println (str (str/repeat " " level)
|
||||||
|
" "
|
||||||
|
(str (:touched shape)))))
|
||||||
(when (:shapes shape)
|
(when (:shapes shape)
|
||||||
(dorun (for [shape-id (:shapes shape)]
|
(dorun (for [shape-id (:shapes shape)]
|
||||||
(show-shape shape-id (inc level) objects))))))
|
(show-shape shape-id (inc level) objects))))))
|
||||||
|
@ -121,5 +127,5 @@
|
||||||
(do
|
(do
|
||||||
(println)
|
(println)
|
||||||
(println (str/format "[%s]" (:name component)))
|
(println (str/format "[%s]" (:name component)))
|
||||||
(show-shape (:id component) 0 (:objects component))))))))
|
(show-shape (:id component) 0 (:objects component)))))))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue