mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
🐛 Fix missed path-data refactor regressions
This commit is contained in:
parent
4dcb9d6d38
commit
0a89a1efd5
@ -2112,7 +2112,7 @@
|
||||
|
||||
;; If both variants (origin and destiny) don't have the same value
|
||||
;; for that attribute, don't copy it.
|
||||
;; Exceptions: :points :selrect and :content can be different
|
||||
;; Exceptions: :points :selrect and path geometry attr can be different
|
||||
;;
|
||||
;; Sample:
|
||||
;; 1. We have a variant with C1 (bg red) and C2 (bg blue).
|
||||
@ -2121,11 +2121,12 @@
|
||||
;; 4. We switch Copy to use C2 as base.
|
||||
;; 5. The bg of Copy now is blue (we ignore the override)
|
||||
(and
|
||||
(not (contains? #{:points :selrect :content} attr))
|
||||
(not (contains? #{:points :selrect :content :path-data} attr))
|
||||
(not= (get origin-ref-shape attr) (get current-shape attr)))
|
||||
|
||||
;; The :content attr cant't be copied to elements of different type
|
||||
(and (= attr :content) (not= (:type previous-shape) (:type current-shape))))
|
||||
;; Content attrs can't be copied to elements of different type
|
||||
(and (contains? #{:content :path-data} attr)
|
||||
(not= (:type previous-shape) (:type current-shape))))
|
||||
|
||||
;; On texts, both text (the actual letters)
|
||||
;; and attrs (bold, font, etc) are in the same attr :content.
|
||||
@ -2140,7 +2141,7 @@
|
||||
|
||||
path-change?
|
||||
(and (= :path (:type current-shape))
|
||||
(contains? #{:points :selrect :content} attr))
|
||||
(contains? #{:points :selrect :path-data} attr))
|
||||
|
||||
;; position-data is a special case because can be affected by :geometry-group and :content-group
|
||||
;; so, if the position-data changes but the geometry is touched we need to reset the position-data
|
||||
|
||||
@ -43,13 +43,13 @@
|
||||
height (dm/get-prop shape :height)
|
||||
selrect (dm/get-prop shape :selrect)
|
||||
type (dm/get-prop shape :type)
|
||||
content (get shape :content)
|
||||
path-data (get shape :path-data)
|
||||
path? (cfh/path-shape? shape)
|
||||
|
||||
path-data
|
||||
(mf/with-memo [path? content]
|
||||
(when (and ^boolean path? (some? content))
|
||||
(.toString content)))
|
||||
path-data-str
|
||||
(mf/with-memo [path? path-data]
|
||||
(when (and ^boolean path? (some? path-data))
|
||||
(.toString path-data)))
|
||||
|
||||
border-attrs
|
||||
(attrs/get-border-props shape)
|
||||
@ -78,7 +78,7 @@
|
||||
:ry (/ height 2)}
|
||||
|
||||
:path
|
||||
#js {:d path-data
|
||||
#js {:d path-data-str
|
||||
:transform nil}
|
||||
|
||||
(let [x (dm/get-prop selrect :x)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user