added multiplication by device pixel ratio to render

This commit is contained in:
Frank Noirot
2021-03-17 00:20:31 -04:00
parent b2c53e6097
commit 02dcb60d5e

View File

@@ -6,10 +6,12 @@ let lastViewPortSize = 'INIT'
let lastCameraSettings = 'INIT'
export const render = async ({ code, settings }) => {
const pixelRatio = window.devicePixelRatio || 1
console.log({ pixelRatio })
const size = settings.viewerSize
? {
x: Math.round(settings.viewerSize?.width),
y: Math.round(settings.viewerSize?.height),
x: Math.round(settings.viewerSize?.width * pixelRatio),
y: Math.round(settings.viewerSize?.height * pixelRatio),
}
: lastViewPortSize
const camera = settings.camera || lastCameraSettings