0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-22 14:39:45 -05:00

🐛 Fix SVG not showing properties at code

This commit is contained in:
alonso.torres 2021-03-29 11:56:36 +02:00 committed by Andrey Antukh
parent 213a8c69fb
commit a14890f163
4 changed files with 8 additions and 19 deletions

View file

@ -62,6 +62,7 @@
- Fix issue with recent files not showing [Taiga #1493](https://tree.taiga.io/project/penpot/issue/1493)
- Fix issue when promoting to owner [Taiga #1494](https://tree.taiga.io/project/penpot/issue/1494)
- Fix cannot click on blocked elements in viewer [Taiga #1430](https://tree.taiga.io/project/penpot/issue/1430)
- Fix SVG not showing properties at code [Taiga #1437](https://tree.taiga.io/project/penpot/issue/1437)
### :arrow_up: Deps updates

View file

@ -63,10 +63,10 @@
(let [shape (unchecked-get props "shape")
childs (unchecked-get props "childs")
frame (unchecked-get props "frame")
svg-element? (and (= :svg-raw (:type shape))
(not= :svg (get-in shape [:content :tag])))]
render-wrapper? (or (not= :svg-raw (:type shape))
(svg-raw/graphic-element? (get-in shape [:content :tag])))]
(if-not svg-element?
(if render-wrapper?
[:> shape-container {:shape shape
:on-mouse-enter (handle-hover-shape shape true)
:on-mouse-leave (handle-hover-shape shape false)

View file

@ -21,7 +21,8 @@
[rumext.alpha :as mf]))
;; Graphic tags
(defonce graphic-element? #{:circle :ellipse :image :line :path :polygon :polyline :rect :text :use})
(defonce graphic-element?
#{:svg :circle :ellipse :image :line :path :polygon :polyline :rect :symbol :text :textPath :use})
;; Context to store a re-mapping of the ids
(def svg-ids-ctx (mf/create-context nil))

View file

@ -16,10 +16,6 @@
[app.common.geom.shapes :as gsh]
[app.main.ui.context :as muc]))
;; This is a list of svg tags that can be grouped in shape-container
;; this allows them to have gradients, shadows and masks
(def svg-elements #{:svg :circle :ellipse :image :line :path :polygon :polyline :rect :symbol :text :textPath :use})
(defn svg-raw-wrapper-factory
[shape-wrapper]
(let [svg-raw-shape (svg-raw/svg-raw-shape shape-wrapper)]
@ -43,21 +39,12 @@
def-ctx? (mf/use-ctx muc/def-ctx)]
(cond
(and (contains? svg-elements tag) (not def-ctx?))
(and (svg-raw/graphic-element? tag) (not def-ctx?))
[:> shape-container { :shape shape }
[:& svg-raw-shape
{:frame frame
:shape shape
:childs childs}]
[:rect.actions
{:x x
:y y
:transform transform
:width width
:height height
:fill "transparent"
:stroke "none"}]]
:childs childs}]]
;; We cannot wrap inside groups the shapes that go inside the defs tag
;; we use the context so we know when we should not render the container