mirror of
https://github.com/penpot/penpot.git
synced 2025-06-14 20:41:39 +02:00
🐛 Fix border radius values with decimals
This commit is contained in:
parent
3dcd640a99
commit
52545692df
2 changed files with 13 additions and 4 deletions
|
@ -61,7 +61,8 @@
|
||||||
- Fix text decoration on button [Taiga #5301](https://tree.taiga.io/project/penpot/issue/5301)
|
- 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 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 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
|
### :arrow_up: Deps updates
|
||||||
|
|
||||||
- Update google fonts catalog (at 2023/07/06) [Taiga #5592](https://tree.taiga.io/project/penpot/issue/5592)
|
- Update google fonts catalog (at 2023/07/06) [Taiga #5592](https://tree.taiga.io/project/penpot/issue/5592)
|
||||||
|
|
|
@ -75,6 +75,14 @@
|
||||||
(fmt/format-size :width value values)
|
(fmt/format-size :width value values)
|
||||||
(fmt/format-size :heigth 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
|
(defn styles-data
|
||||||
[shape]
|
[shape]
|
||||||
{:position {:props [:type]
|
{:position {:props [:type]
|
||||||
|
@ -90,7 +98,7 @@
|
||||||
:rx "border-radius"
|
:rx "border-radius"
|
||||||
:r1 "border-radius"}
|
:r1 "border-radius"}
|
||||||
:format {:rotation #(str/fmt "rotate(%sdeg)" %)
|
:format {:rotation #(str/fmt "rotate(%sdeg)" %)
|
||||||
:r1 #(apply str/fmt "%spx %spx %spx %spx" %)
|
:r1 format-border-radius
|
||||||
:width #(get-size :width %)
|
:width #(get-size :width %)
|
||||||
:height #(get-size :height %)}
|
:height #(get-size :height %)}
|
||||||
:multi {:r1 [:r1 :r2 :r3 :r4]}}
|
:multi {:r1 [:r1 :r2 :r3 :r4]}}
|
||||||
|
@ -236,9 +244,9 @@
|
||||||
(str/join "\n")))))
|
(str/join "\n")))))
|
||||||
|
|
||||||
(defn shape->properties [shape]
|
(defn shape->properties [shape]
|
||||||
(let [;; This property is added in an earlier step (code.cljs),
|
(let [;; This property is added in an earlier step (code.cljs),
|
||||||
;; it will come with a vector of flex-items if any.
|
;; it will come with a vector of flex-items if any.
|
||||||
;; If there are none it will continue as usual.
|
;; If there are none it will continue as usual.
|
||||||
flex-items (:flex-items shape)
|
flex-items (:flex-items shape)
|
||||||
props (->> (styles-data shape) vals (mapcat :props))
|
props (->> (styles-data shape) vals (mapcat :props))
|
||||||
to-prop (->> (styles-data shape) vals (map :to-prop) (reduce merge))
|
to-prop (->> (styles-data shape) vals (map :to-prop) (reduce merge))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue