mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
🐛 Fix blend mode against background
This commit is contained in:
@@ -284,7 +284,8 @@
|
||||
(p/fmap (fn [ready?]
|
||||
(when ready?
|
||||
(reset! canvas-init? true)
|
||||
(wasm.api/assign-canvas canvas)))))
|
||||
(wasm.api/assign-canvas canvas)
|
||||
(wasm.api/set-canvas-background background)))))
|
||||
(fn []
|
||||
(wasm.api/clear-canvas))))
|
||||
|
||||
@@ -304,6 +305,10 @@
|
||||
(when @canvas-init?
|
||||
(wasm.api/set-view zoom vbox)))
|
||||
|
||||
(mf/with-effect [background]
|
||||
(when @canvas-init?
|
||||
(wasm.api/set-canvas-background background)))
|
||||
|
||||
(hooks/setup-dom-events zoom disable-paste in-viewport? read-only? drawing-tool drawing-path?)
|
||||
(hooks/setup-viewport-size vport viewport-ref)
|
||||
(hooks/setup-cursor cursor alt? mod? space? panning drawing-tool drawing-path? node-editing? z? read-only?)
|
||||
|
||||
@@ -345,6 +345,11 @@
|
||||
(set! (.-width canvas) (* dpr (.-clientWidth ^js canvas)))
|
||||
(set! (.-height canvas) (* dpr (.-clientHeight ^js canvas))))
|
||||
|
||||
(defn set-canvas-background
|
||||
[background]
|
||||
(let [rgba (rgba-from-hex background 1)]
|
||||
(h/call internal-module "_set_canvas_background" rgba)))
|
||||
|
||||
(defonce module
|
||||
(delay
|
||||
(if (exists? js/dynamicImport)
|
||||
|
||||
Reference in New Issue
Block a user