cognitedata / reveal

Cognite Reveal 3D viewer

Home Page:https://cognitedata.github.io/reveal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`worldToNormalizedViewportCoordinates` does not support devices with a non 1-to-1 pixel ratio

hayer opened this issue · comments

The current implementation of worldToNormalizedViewportCoordinates seems to not support pixel ratios different from 1.

const pixelRatio = 1; // renderer.getPixelRatio();
...

const x = (position.x + 1) / (scaleX * pixelRatio * 2);
const y = (-position.y + 1) / (scaleY * pixelRatio * 2);

Thank you - we'll have a look and merge this :)

We ended up addressing this issue with PR #1700. I don't know what specific issue (if any) you experienced with the previous implementation, but it was hopefully addressed by that PR.