mirror of
https://github.com/penpot/penpot.git
synced 2025-08-04 01:18:29 +02:00
🐛 Fix problem with grid component synchronization
This commit is contained in:
parent
be31371892
commit
7aeb5498a1
2 changed files with 72 additions and 3 deletions
|
@ -13,6 +13,7 @@
|
|||
[app.common.files.helpers :as cfh]
|
||||
[app.common.geom.point :as gpt]
|
||||
[app.common.geom.shapes :as gsh]
|
||||
[app.common.geom.shapes.tree-seq :as gsts]
|
||||
[app.common.logging :as l]
|
||||
[app.common.schema :as sm]
|
||||
[app.common.text :as ct]
|
||||
|
@ -176,6 +177,13 @@
|
|||
(when (:shape-ref shape)
|
||||
(get-component-shape file-data component (:shape-ref shape))))
|
||||
|
||||
(defn get-shape-in-copy
|
||||
"Given a shape in the main component and the root of the copy component returns the equivalent
|
||||
shape inside the root copy that matches the main-shape"
|
||||
[file-data main-shape root-copy]
|
||||
(->> (gsts/get-children-seq (:id root-copy) (:objects file-data))
|
||||
(d/seek #(= (:shape-ref %) (:id main-shape)))))
|
||||
|
||||
(defn find-ref-shape
|
||||
"Locate the near component in the local file or libraries, and retrieve the shape
|
||||
referenced by the instance shape."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue