0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-18 21:06:11 -05:00

Add parent property to shapes

This commit is contained in:
alonso.torres 2024-07-11 12:40:40 +02:00
parent 8ded4811bb
commit 60f637e947

View file

@ -819,6 +819,13 @@
:else :else
(st/emit! (dw/update-position id {:y value})))))} (st/emit! (dw/update-position id {:y value})))))}
{:name "parent"
;; not enumerable so there are no infinite loops
:enumerable false
:get (fn [self]
(let [shape (u/proxy->shape self)
parent-id (:parent-id shape)]
(shape-proxy (obj/get self "$file") (obj/get self "$page") parent-id)))}
{:name "parentX" {:name "parentX"
:get (fn [self] :get (fn [self]
(let [shape (u/proxy->shape self) (let [shape (u/proxy->shape self)