INNER CODE UNIT · JavaScript
invalidateCanvasRect
NeoAxis/NeoAxisEngine · Project/Sources/NeoAxis.Player.Web/wwwroot/main.js:267
const invalidateCanvasRect = () =>
{
cachedRect = null;
}
const getCanvasRect = () =>
{
if (cachedRect === null)
cachedRect = canvas.getBoundingClientRect();
return cachedRect;
}
const measureDevicePixelSize = () =>
{
const devicePixelRatio = window.devicePixelRatio || 1.0;
const rect = getCanvasRect();
const width = Math.round(rect.right * devicePixelRatio) - Math.round(rect.left * devicePixelRatio);