UNPKG

@cornerstonejs/core

Version:
12 lines (11 loc) 447 B
function getDevicePixelRatio() { return (typeof window !== 'undefined' && window.devicePixelRatio) || 1; } export function deviceToCssPixels(point) { const devicePixelRatio = getDevicePixelRatio(); return [point[0] / devicePixelRatio, point[1] / devicePixelRatio]; } export function cssToDevicePixels(point) { const devicePixelRatio = getDevicePixelRatio(); return [point[0] * devicePixelRatio, point[1] * devicePixelRatio]; }