mirror of
https://github.com/penpot/penpot.git
synced 2025-05-14 07:56:38 +02:00
♻️ Refactor debug options into its own struct, along with dpr
This commit is contained in:
parent
230e011003
commit
3e99de19f5
4 changed files with 62 additions and 31 deletions
|
@ -181,17 +181,17 @@
|
|||
(defn assign-canvas
|
||||
[canvas]
|
||||
(let [gl (unchecked-get internal-module "GL")
|
||||
init-fn (unchecked-get internal-module "_init")
|
||||
|
||||
context (.getContext ^js canvas "webgl2" canvas-options)
|
||||
dpr js/window.devicePixelRatio
|
||||
|
||||
;; Register the context with emscripten
|
||||
handle (.registerContext ^js gl context #js {"majorVersion" 2})]
|
||||
(.makeContextCurrent ^js gl handle)
|
||||
;; Initialize Skia
|
||||
(^function init-fn (.-width ^js canvas)
|
||||
(.-height ^js canvas)
|
||||
1)
|
||||
|
||||
;; Initialize Wasm Render Engine
|
||||
(h/call internal-module "_init" (.-width ^js canvas) (.-height ^js canvas))
|
||||
(h/call internal-module "_set_render_options" 0x01 (or dpr 0))
|
||||
|
||||
(set! (.-width canvas) (.-clientWidth ^js canvas))
|
||||
(set! (.-height canvas) (.-clientHeight ^js canvas))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue