mirror of
https://github.com/penpot/penpot.git
synced 2025-02-15 19:48:22 -05:00
🐛 Fix remove time debug info
This commit is contained in:
parent
15418a252e
commit
db8e829339
1 changed files with 16 additions and 16 deletions
|
@ -21,24 +21,24 @@
|
||||||
|
|
||||||
(defn- draw-thumbnail-canvas
|
(defn- draw-thumbnail-canvas
|
||||||
[canvas-node img-node]
|
[canvas-node img-node]
|
||||||
(time (try
|
(try
|
||||||
(when (and (some? canvas-node) (some? img-node))
|
(when (and (some? canvas-node) (some? img-node))
|
||||||
(let [canvas-context (.getContext canvas-node "2d")
|
(let [canvas-context (.getContext canvas-node "2d")
|
||||||
canvas-width (.-width canvas-node)
|
canvas-width (.-width canvas-node)
|
||||||
canvas-height (.-height canvas-node)]
|
canvas-height (.-height canvas-node)]
|
||||||
|
|
||||||
(set! (.-width canvas-node) (* thumbnail-scale-factor canvas-width))
|
(set! (.-width canvas-node) (* thumbnail-scale-factor canvas-width))
|
||||||
(set! (.-height canvas-node) (* thumbnail-scale-factor canvas-height))
|
(set! (.-height canvas-node) (* thumbnail-scale-factor canvas-height))
|
||||||
(.setTransform canvas-context thumbnail-scale-factor 0 0 thumbnail-scale-factor 0 0)
|
(.setTransform canvas-context thumbnail-scale-factor 0 0 thumbnail-scale-factor 0 0)
|
||||||
(set! (.-imageSmoothingEnabled canvas-context) true)
|
(set! (.-imageSmoothingEnabled canvas-context) true)
|
||||||
(set! (.-imageSmoothingQuality canvas-context) "high")
|
(set! (.-imageSmoothingQuality canvas-context) "high")
|
||||||
|
|
||||||
(.clearRect canvas-context 0 0 canvas-width canvas-height)
|
(.clearRect canvas-context 0 0 canvas-width canvas-height)
|
||||||
(.drawImage canvas-context img-node 0 0 canvas-width canvas-height)
|
(.drawImage canvas-context img-node 0 0 canvas-width canvas-height)
|
||||||
(.toDataURL canvas-node "image/png" 1.0)))
|
(.toDataURL canvas-node "image/png" 1.0)))
|
||||||
(catch :default err
|
(catch :default err
|
||||||
(.error js/console err)
|
(.error js/console err)
|
||||||
nil))))
|
nil)))
|
||||||
|
|
||||||
(defn use-render-thumbnail
|
(defn use-render-thumbnail
|
||||||
"Hook that will create the thumbnail thata"
|
"Hook that will create the thumbnail thata"
|
||||||
|
|
Loading…
Add table
Reference in a new issue