diff --git a/CHANGES.md b/CHANGES.md index 7d40bba9e..65a48dc53 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -76,6 +76,7 @@ - Fix precision for wrap in flex [Taiga #5072](https://tree.taiga.io/project/penpot/issue/5072) - Fix relative position overlay positioning [Taiga #5092](https://tree.taiga.io/project/penpot/issue/5092) - Fix hide grid keyboard shortcut [Github #3071](https://github.com/penpot/penpot/pull/3071) +- Fix problem with opacity in imported SVG's [Taiga #4923](https://tree.taiga.io/project/penpot/issue/4923) ### :heart: Community contributions by (Thank you!) - To @ondrejkonec: for contributing to the code with: diff --git a/frontend/src/app/main/data/workspace/svg_upload.cljs b/frontend/src/app/main/data/workspace/svg_upload.cljs index 5d9d911f8..ae5354b15 100644 --- a/frontend/src/app/main/data/workspace/svg_upload.cljs +++ b/frontend/src/app/main/data/workspace/svg_upload.cljs @@ -164,11 +164,13 @@ (cond-> shape (get-in shape [:svg-attrs :opacity]) (-> (update :svg-attrs dissoc :opacity) - (assoc :opacity (get-in shape [:svg-attrs :opacity]))) + (assoc :opacity (-> (get-in shape [:svg-attrs :opacity]) + (d/parse-double)))) (get-in shape [:svg-attrs :style :opacity]) (-> (update-in [:svg-attrs :style] dissoc :opacity) - (assoc :opacity (get-in shape [:svg-attrs :style :opacity]))) + (assoc :opacity (-> (get-in shape [:svg-attrs :style :opacity]) + (d/parse-double)))) (get-in shape [:svg-attrs :mix-blend-mode]) @@ -410,7 +412,8 @@ (assoc :strokes []) (assoc :svg-defs (select-keys (:defs svg-data) references)) (setup-fill) - (setup-stroke)) + (setup-stroke) + (setup-opacity)) shape (cond-> shape hidden (assoc :hidden true))