🐛 Fix border radius values with decimals

This commit is contained in:
Eva 2023-07-11 11:26:31 +02:00
parent 3dcd640a99
commit 52545692df
2 changed files with 13 additions and 4 deletions

View file

@ -61,6 +61,7 @@
- Fix text decoration on button [Taiga #5301](https://tree.taiga.io/project/penpot/issue/5301)
- Fix menu order on design tab [Taiga #5195](https://tree.taiga.io/project/penpot/issue/5195)
- Fix search bar width on layer tab [Taiga #5445](https://tree.taiga.io/project/penpot/issue/5445)
- Fix border radius values with decimals [Taiga #5283](https://tree.taiga.io/project/penpot/issue/5283)
### :arrow_up: Deps updates

View file

@ -75,6 +75,14 @@
(fmt/format-size :width value values)
(fmt/format-size :heigth value values))))
(defn format-border-radius
[values]
(and (coll? values) (d/not-empty? values))
(->> values
(map fmt/format-pixels)
(str/join " ")))
(defn styles-data
[shape]
{:position {:props [:type]
@ -90,7 +98,7 @@
:rx "border-radius"
:r1 "border-radius"}
:format {:rotation #(str/fmt "rotate(%sdeg)" %)
:r1 #(apply str/fmt "%spx %spx %spx %spx" %)
:r1 format-border-radius
:width #(get-size :width %)
:height #(get-size :height %)}
:multi {:r1 [:r1 :r2 :r3 :r4]}}