MCPcopy Index your code
hub / github.com/microsoft/SandDance / cssToDevicePixels

Function cssToDevicePixels

docs/app/js/sanddance-app.js:59413–59419  ·  view source on GitHub ↗
(gl, cssPixel)

Source from the content-addressed store, hash-verified

59411 return 1;
59412}
59413function cssToDevicePixels(gl, cssPixel) {
59414 var yInvert = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
59415 var ratio = cssToDeviceRatio(gl);
59416 var width = gl.drawingBufferWidth;
59417 var height = gl.drawingBufferHeight;
59418 return scalePixels(cssPixel, ratio, width, height, yInvert);
59419}
59420function getDevicePixelRatio(useDevicePixels) {
59421 var windowRatio = typeof window === "undefined" ? 1 : window.devicePixelRatio || 1;
59422 if (Number.isFinite(useDevicePixels)) return useDevicePixels <= 0 ? 1 : useDevicePixels;

Callers

nothing calls this directly

Calls 2

cssToDeviceRatioFunction · 0.70
scalePixelsFunction · 0.70

Tested by

no test coverage detected