mirror of
https://github.com/penpot/penpot.git
synced 2025-05-12 09:06:37 +02:00
♻️ Change pixel overlay rendering to use rasterizer
This commit is contained in:
parent
0496b1f4e3
commit
537435372a
2 changed files with 15 additions and 3 deletions
|
@ -61,7 +61,7 @@
|
|||
(.push ^js queue message))
|
||||
|
||||
(defn render
|
||||
"Renders a thumbnail."
|
||||
"Renders an SVG"
|
||||
[{:keys [data styles width] :as params}]
|
||||
(let [id (dm/str (uuid/next))
|
||||
payload #js {:data data :styles styles :width width}
|
||||
|
@ -81,6 +81,14 @@
|
|||
"failure" (rx/throw (js/Error. (unchecked-get msg "payload"))))))
|
||||
(rx/take 1))))
|
||||
|
||||
(defn render-node
|
||||
"Renders an SVG using a node"
|
||||
[{:keys [node styles width] :as params}]
|
||||
(let [width (or width (dom/get-attribute node "width"))
|
||||
styles (or styles "")
|
||||
data (dom/node->xml node)]
|
||||
(render {:data data :styles styles :width width})))
|
||||
|
||||
(defn init!
|
||||
"Initializes the thumbnail renderer."
|
||||
[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue