mirror of
https://github.com/penpot/penpot.git
synced 2025-05-14 06:36:36 +02:00
✨ Add config flag for DPR
This commit is contained in:
parent
3e99de19f5
commit
52a705ac02
1 changed files with 2 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
(defonce internal-frame-id nil)
|
(defonce internal-frame-id nil)
|
||||||
(defonce internal-module #js {})
|
(defonce internal-module #js {})
|
||||||
|
(defonce use-dpr? (contains? cf/flags :render-wasm-dpr))
|
||||||
|
|
||||||
;; This should never be called from the outside.
|
;; This should never be called from the outside.
|
||||||
;; This function receives a "time" parameter that we're not using but maybe in the future could be useful (it is the time since
|
;; This function receives a "time" parameter that we're not using but maybe in the future could be useful (it is the time since
|
||||||
|
@ -182,7 +183,7 @@
|
||||||
[canvas]
|
[canvas]
|
||||||
(let [gl (unchecked-get internal-module "GL")
|
(let [gl (unchecked-get internal-module "GL")
|
||||||
context (.getContext ^js canvas "webgl2" canvas-options)
|
context (.getContext ^js canvas "webgl2" canvas-options)
|
||||||
dpr js/window.devicePixelRatio
|
dpr (when use-dpr? js/window.devicePixelRatio)
|
||||||
|
|
||||||
;; Register the context with emscripten
|
;; Register the context with emscripten
|
||||||
handle (.registerContext ^js gl context #js {"majorVersion" 2})]
|
handle (.registerContext ^js gl context #js {"majorVersion" 2})]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue