diff --git a/CHANGES.md b/CHANGES.md index c19d710d4b..6adb776a6f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -32,6 +32,7 @@ - Fix "Components visibility and opacity" [#4694](https://github.com/penpot/penpot/issues/4694) - Fix "Attribute overrides in copies are not exported in zip file" [Taiga #8072](https://tree.taiga.io/project/penpot/issue/8072) - Fix group not automatically selected in the Layers panel after creation [Taiga #8078](https://tree.taiga.io/project/penpot/issue/8078) +- Fix export boards loses opacity [Taiga #7592](https://tree.taiga.io/project/penpot/issue/7592) ## 2.0.3 diff --git a/frontend/src/app/worker/import.cljs b/frontend/src/app/worker/import.cljs index 998459c604..901b3edcd4 100644 --- a/frontend/src/app/worker/import.cljs +++ b/frontend/src/app/worker/import.cljs @@ -278,7 +278,6 @@ old-id (parser/get-id node) interactions (->> (parser/parse-interactions node) (mapv #(update % :destination resolve))) - data (-> (parser/parse-data type node) (resolve-data-ids type context) (cond-> (some? old-id) diff --git a/frontend/src/app/worker/import/parser.cljs b/frontend/src/app/worker/import/parser.cljs index 5eda72daa9..adeb0dd5a9 100644 --- a/frontend/src/app/worker/import/parser.cljs +++ b/frontend/src/app/worker/import/parser.cljs @@ -244,19 +244,22 @@ (first)) ;; The nodes with the "frame-background" class can have some anidation depending on the strokes they have - g-nodes (find-all-nodes node :g) - defs-nodes (flatten (map #(find-all-nodes % :defs) g-nodes)) - gg-nodes (flatten (map #(find-all-nodes % :g) g-nodes)) + g-nodes (find-all-nodes node :g) + defs-nodes (flatten (map #(find-all-nodes % :defs) g-nodes)) + gg-nodes (flatten (map #(find-all-nodes % :g) g-nodes)) + ;; The first g node contains the opacity for frames + main-g-node (first g-nodes) - rect-nodes (flatten [[(find-all-nodes node :rect)] - (map #(find-all-nodes % #{:rect :path}) defs-nodes) - (map #(find-all-nodes % #{:rect :path}) g-nodes) - (map #(find-all-nodes % #{:rect :path}) gg-nodes)]) - svg-node (d/seek #(= "frame-background" (get-in % [:attrs :class])) rect-nodes)] + rect-nodes (flatten [[(find-all-nodes node :rect)] + (map #(find-all-nodes % #{:rect :path}) defs-nodes) + (map #(find-all-nodes % #{:rect :path}) g-nodes) + (map #(find-all-nodes % #{:rect :path}) gg-nodes)]) + svg-node (d/seek #(= "frame-background" (get-in % [:attrs :class])) rect-nodes)] (merge (add-attrs {} (:attrs frame-clip-rect-node)) (add-attrs {} (:attrs svg-node)) + (add-attrs {} (:attrs main-g-node)) node-attrs)) (= type :svg-raw)