mirror of
https://github.com/penpot/penpot.git
synced 2025-07-23 16:17:23 +02:00
🐛 Fix SVG not showing properties at code
This commit is contained in:
parent
213a8c69fb
commit
a14890f163
4 changed files with 8 additions and 19 deletions
|
@ -62,6 +62,7 @@
|
||||||
- Fix issue with recent files not showing [Taiga #1493](https://tree.taiga.io/project/penpot/issue/1493)
|
- 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 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 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
|
### :arrow_up: Deps updates
|
||||||
|
|
|
@ -63,10 +63,10 @@
|
||||||
(let [shape (unchecked-get props "shape")
|
(let [shape (unchecked-get props "shape")
|
||||||
childs (unchecked-get props "childs")
|
childs (unchecked-get props "childs")
|
||||||
frame (unchecked-get props "frame")
|
frame (unchecked-get props "frame")
|
||||||
svg-element? (and (= :svg-raw (:type shape))
|
render-wrapper? (or (not= :svg-raw (:type shape))
|
||||||
(not= :svg (get-in shape [:content :tag])))]
|
(svg-raw/graphic-element? (get-in shape [:content :tag])))]
|
||||||
|
|
||||||
(if-not svg-element?
|
(if render-wrapper?
|
||||||
[:> shape-container {:shape shape
|
[:> shape-container {:shape shape
|
||||||
:on-mouse-enter (handle-hover-shape shape true)
|
:on-mouse-enter (handle-hover-shape shape true)
|
||||||
:on-mouse-leave (handle-hover-shape shape false)
|
:on-mouse-leave (handle-hover-shape shape false)
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
[rumext.alpha :as mf]))
|
[rumext.alpha :as mf]))
|
||||||
|
|
||||||
;; Graphic tags
|
;; 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
|
;; Context to store a re-mapping of the ids
|
||||||
(def svg-ids-ctx (mf/create-context nil))
|
(def svg-ids-ctx (mf/create-context nil))
|
||||||
|
|
|
@ -16,10 +16,6 @@
|
||||||
[app.common.geom.shapes :as gsh]
|
[app.common.geom.shapes :as gsh]
|
||||||
[app.main.ui.context :as muc]))
|
[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
|
(defn svg-raw-wrapper-factory
|
||||||
[shape-wrapper]
|
[shape-wrapper]
|
||||||
(let [svg-raw-shape (svg-raw/svg-raw-shape 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)]
|
def-ctx? (mf/use-ctx muc/def-ctx)]
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
(and (contains? svg-elements tag) (not def-ctx?))
|
(and (svg-raw/graphic-element? tag) (not def-ctx?))
|
||||||
[:> shape-container { :shape shape }
|
[:> shape-container { :shape shape }
|
||||||
[:& svg-raw-shape
|
[:& svg-raw-shape
|
||||||
{:frame frame
|
{:frame frame
|
||||||
:shape shape
|
:shape shape
|
||||||
:childs childs}]
|
:childs childs}]]
|
||||||
|
|
||||||
[:rect.actions
|
|
||||||
{:x x
|
|
||||||
:y y
|
|
||||||
:transform transform
|
|
||||||
:width width
|
|
||||||
:height height
|
|
||||||
:fill "transparent"
|
|
||||||
:stroke "none"}]]
|
|
||||||
|
|
||||||
;; We cannot wrap inside groups the shapes that go inside the defs tag
|
;; 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
|
;; we use the context so we know when we should not render the container
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue