{"version":3,"file":"round.mjs","sources":["../../../../src/projection/geometry/round.ts"],"sourcesContent":["import type { Axis, Box } from \"motion-utils\"\nimport { noop } from \"motion-utils\"\n\nconst userAgentContains = (string: string) =>\n    typeof navigator !== \"undefined\" &&\n    navigator.userAgent &&\n    navigator.userAgent.toLowerCase().includes(string)\n\n/**\n * Measured bounding boxes must be rounded in Safari and\n * left untouched in Chrome, otherwise non-integer layouts within scaled-up elements\n * can appear to jump.\n */\nconst roundPoint =\n    userAgentContains(\"applewebkit/\") && !userAgentContains(\"chrome/\")\n        ? Math.round\n        : noop\n\nfunction roundAxis(axis: Axis): void {\n    // Round to the nearest .5 pixels to support subpixel layouts\n    axis.min = roundPoint(axis.min)\n    axis.max = roundPoint(axis.max)\n}\n\nexport function roundBox(box: Box): void {\n    roundAxis(box.x)\n    roundAxis(box.y)\n}\n"],"names":[],"mappings":";;AAGA,MAAM,iBAAiB,GAAG,CAAC,MAAc,KACrC,OAAO,SAAS,KAAK,WAAW;AAChC,IAAA,SAAS,CAAC,SAAS;IACnB,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;AAEtD;;;;AAIG;AACH,MAAM,UAAU,GACZ,iBAAiB,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS;MAC3D,IAAI,CAAC;MACL,IAAI;AAEd,SAAS,SAAS,CAAC,IAAU,EAAA;;IAEzB,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;IAC/B,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;AACnC;AAEM,SAAU,QAAQ,CAAC,GAAQ,EAAA;AAC7B,IAAA,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAChB,IAAA,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACpB;;;;"}