mirror of
https://github.com/penpot/penpot.git
synced 2025-02-15 03:28:25 -05:00
🐛 Fix set border radius for groups
This commit is contained in:
parent
8de55ce054
commit
e3e148c569
2 changed files with 25 additions and 4 deletions
|
@ -38,7 +38,25 @@
|
||||||
type (:type shape) ; always be :group
|
type (:type shape) ; always be :group
|
||||||
|
|
||||||
measure-values
|
measure-values
|
||||||
(select-keys shape measure-attrs)
|
(merge
|
||||||
|
;; All values extracted from the group shape, except
|
||||||
|
;; border radius, that needs to be looked up from children
|
||||||
|
(geom/get-attrs-multi (map #(get-shape-attrs
|
||||||
|
%
|
||||||
|
measure-attrs
|
||||||
|
nil
|
||||||
|
nil
|
||||||
|
nil)
|
||||||
|
[shape])
|
||||||
|
measure-attrs)
|
||||||
|
(geom/get-attrs-multi (map #(get-shape-attrs
|
||||||
|
%
|
||||||
|
[:rx :ry]
|
||||||
|
nil
|
||||||
|
nil
|
||||||
|
nil)
|
||||||
|
shape-with-children)
|
||||||
|
[:rx :ry]))
|
||||||
|
|
||||||
fill-values
|
fill-values
|
||||||
(geom/get-attrs-multi shape-with-children fill-attrs)
|
(geom/get-attrs-multi shape-with-children fill-attrs)
|
||||||
|
@ -114,6 +132,7 @@
|
||||||
text-transform-attrs)]
|
text-transform-attrs)]
|
||||||
[:*
|
[:*
|
||||||
[:& measures-menu {:ids [id]
|
[:& measures-menu {:ids [id]
|
||||||
|
:ids-with-children ids-with-children
|
||||||
:type type
|
:type type
|
||||||
:values measure-values}]
|
:values measure-values}]
|
||||||
[:& fill-menu {:ids ids-with-children
|
[:& fill-menu {:ids ids-with-children
|
||||||
|
|
|
@ -35,10 +35,12 @@
|
||||||
|
|
||||||
;; -- User/drawing coords
|
;; -- User/drawing coords
|
||||||
(mf/defc measures-menu
|
(mf/defc measures-menu
|
||||||
[{:keys [options ids values] :as props}]
|
[{:keys [options ids ids-with-children values] :as props}]
|
||||||
(let [options (or options #{:size :position :rotation :radius})
|
(let [options (or options #{:size :position :rotation :radius})
|
||||||
locale (i18n/use-locale)
|
locale (i18n/use-locale)
|
||||||
|
|
||||||
|
ids-with-children (or ids-with-children ids)
|
||||||
|
|
||||||
old-shapes (deref (refs/objects-by-id ids))
|
old-shapes (deref (refs/objects-by-id ids))
|
||||||
frames (map #(deref (refs/object-by-id (:frame-id %))) old-shapes)
|
frames (map #(deref (refs/object-by-id (:frame-id %))) old-shapes)
|
||||||
shapes (map gsh/transform-shape frames old-shapes)
|
shapes (map gsh/transform-shape frames old-shapes)
|
||||||
|
@ -93,8 +95,8 @@
|
||||||
(let [value (-> (dom/get-target event)
|
(let [value (-> (dom/get-target event)
|
||||||
(dom/get-value)
|
(dom/get-value)
|
||||||
(d/parse-integer 0))]
|
(d/parse-integer 0))]
|
||||||
(st/emit! (dwc/update-shapes-recursive
|
(st/emit! (dwc/update-shapes
|
||||||
ids
|
ids-with-children
|
||||||
#(if (:rx %)
|
#(if (:rx %)
|
||||||
(assoc % :rx value :ry value)
|
(assoc % :rx value :ry value)
|
||||||
%)))))
|
%)))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue