mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
🐛 Fix problem with copy/paste props (#5867)
This commit is contained in:
parent
f90c63b5f0
commit
0aa95ea058
@ -588,51 +588,51 @@
|
|||||||
;; - Blur
|
;; - Blur
|
||||||
;; - Border radius
|
;; - Border radius
|
||||||
(def ^:private basic-extract-props
|
(def ^:private basic-extract-props
|
||||||
[:fills
|
#{:fills
|
||||||
:strokes
|
:strokes
|
||||||
:opacity
|
:opacity
|
||||||
|
|
||||||
;; Layout Item
|
;; Layout Item
|
||||||
:layout-item-margin
|
:layout-item-margin
|
||||||
:layout-item-margin-type
|
:layout-item-margin-type
|
||||||
:layout-item-h-sizing
|
:layout-item-h-sizing
|
||||||
:layout-item-v-sizing
|
:layout-item-v-sizing
|
||||||
:layout-item-max-h
|
:layout-item-max-h
|
||||||
:layout-item-min-h
|
:layout-item-min-h
|
||||||
:layout-item-max-w
|
:layout-item-max-w
|
||||||
:layout-item-min-w
|
:layout-item-min-w
|
||||||
:layout-item-absolute
|
:layout-item-absolute
|
||||||
:layout-item-z-index
|
:layout-item-z-index
|
||||||
|
|
||||||
;; Constraints
|
;; Constraints
|
||||||
:constraints-h
|
:constraints-h
|
||||||
:constraints-v
|
:constraints-v
|
||||||
|
|
||||||
:shadow
|
:shadow
|
||||||
:blur
|
:blur
|
||||||
|
|
||||||
;; Radius
|
;; Radius
|
||||||
:r1
|
:r1
|
||||||
:r2
|
:r2
|
||||||
:r3
|
:r3
|
||||||
:r4])
|
:r4})
|
||||||
|
|
||||||
(def ^:private layout-extract-props
|
(def ^:private layout-extract-props
|
||||||
[:layout
|
#{:layout
|
||||||
:layout-flex-dir
|
:layout-flex-dir
|
||||||
:layout-gap-type
|
:layout-gap-type
|
||||||
:layout-gap
|
:layout-gap
|
||||||
:layout-wrap-type
|
:layout-wrap-type
|
||||||
:layout-align-items
|
:layout-align-items
|
||||||
:layout-align-content
|
:layout-align-content
|
||||||
:layout-justify-items
|
:layout-justify-items
|
||||||
:layout-justify-content
|
:layout-justify-content
|
||||||
:layout-padding-type
|
:layout-padding-type
|
||||||
:layout-padding
|
:layout-padding
|
||||||
:layout-grid-dir
|
:layout-grid-dir
|
||||||
:layout-grid-rows
|
:layout-grid-rows
|
||||||
:layout-grid-columns
|
:layout-grid-columns
|
||||||
:layout-grid-cells])
|
:layout-grid-cells})
|
||||||
|
|
||||||
(defn extract-props
|
(defn extract-props
|
||||||
"Retrieves an object with the 'pasteable' properties for a shape."
|
"Retrieves an object with the 'pasteable' properties for a shape."
|
||||||
@ -668,10 +668,13 @@
|
|||||||
[props shape]
|
[props shape]
|
||||||
(d/patch-object props (select-keys shape layout-extract-props)))]
|
(d/patch-object props (select-keys shape layout-extract-props)))]
|
||||||
|
|
||||||
(-> shape
|
(let [;; For texts we don't extract the fill
|
||||||
(select-keys basic-extract-props)
|
extract-props
|
||||||
(cond-> (cfh/text-shape? shape) (extract-text-props shape))
|
(cond-> basic-extract-props (cfh/text-shape? shape) (disj :fills))]
|
||||||
(cond-> (ctsl/any-layout? shape) (extract-layout-props shape)))))
|
(-> shape
|
||||||
|
(select-keys extract-props)
|
||||||
|
(cond-> (cfh/text-shape? shape) (extract-text-props shape))
|
||||||
|
(cond-> (ctsl/any-layout? shape) (extract-layout-props shape))))))
|
||||||
|
|
||||||
(defn patch-props
|
(defn patch-props
|
||||||
"Given the object of `extract-props` applies it to a shape. Adapt the shape if necesary"
|
"Given the object of `extract-props` applies it to a shape. Adapt the shape if necesary"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user