0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 15:39:50 -05:00

Merge pull request #4850 from penpot/alotor-bug-api-svg

🐛 Fix problem when creating SVG images
This commit is contained in:
Andrey Antukh 2024-07-04 17:15:35 +02:00 committed by GitHub
commit 5ae30ea9bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -467,4 +467,5 @@
(watch [_ _ _]
(->> (svg->clj [name svg-string])
(rx/take 1)
(rx/map #(svg/add-svg-shapes id % position {:change-selection? false}))))))
(rx/map #(svg/add-svg-shapes id % position {:ignore-selection? true
:change-selection? false}))))))

View file

@ -64,7 +64,8 @@
([svg-data position]
(add-svg-shapes nil svg-data position nil))
([id svg-data position {:keys [change-selection?] :or {change-selection? false}}]
([id svg-data position {:keys [change-selection? ignore-selection?]
:or {ignore-selection? false change-selection? true}}]
(ptk/reify ::add-svg-shapes
ptk/WatchEvent
(watch [it state _]
@ -73,7 +74,7 @@
page-id (:current-page-id state)
objects (wsh/lookup-page-objects state page-id)
frame-id (ctst/top-nested-frame objects position)
selected (wsh/lookup-selected state)
selected (if ignore-selection? #{} (wsh/lookup-selected state))
base (cfh/get-base-shape objects selected)
selected-id (first selected)