0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-01 01:21:21 -05:00

🐛 Fix incorrect assumption about parseFloat on fixing percent

on parsing and normalizing svg elements
This commit is contained in:
Andrey Antukh 2024-01-16 19:39:36 +01:00
parent 9b59b92464
commit f9d63dba00

View file

@ -964,8 +964,7 @@
is-other? #{:r :stroke-width}] is-other? #{:r :stroke-width}]
(if is-percent? (if is-percent?
;; JS parseFloat removes the % symbol (let [attr-num (d/parse-double (str/rtrim attr-val "%"))]
(let [attr-num (d/parse-double attr-val)]
(str (cond (str (cond
(is-x? attr-key) (fix-coord :x :width attr-num) (is-x? attr-key) (fix-coord :x :width attr-num)
(is-y? attr-key) (fix-coord :y :height attr-num) (is-y? attr-key) (fix-coord :y :height attr-num)