Maintain device pixel ratio during resize, so the render won't be blurry when the users set the scale for the whole webpage.

This commit is contained in:
Viktor Kovacs 2021-04-25 15:33:36 +02:00
parent 8b626098e9
commit b47d6b0ce4

View File

@ -142,6 +142,9 @@ OV.Viewer = class
ResizeRenderer (width, height)
{
if (window.devicePixelRatio) {
this.renderer.setPixelRatio (window.devicePixelRatio);
}
this.camera.aspect = width / height;
this.camera.updateProjectionMatrix ();
this.renderer.setSize (width, height);