FezVrasta/popper.js

View on GitHub
packages/react-dom/src/utils/roundByDPR.ts

Summary

Maintainability
A
55 mins
Test Coverage
import {getDPR} from './getDPR';

export function roundByDPR(element: Element, value: number) {
  const dpr = getDPR(element);
  return Math.round(value * dpr) / dpr;
}