You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
3.2 KiB
1 line
3.2 KiB
{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport Dimensions from \"../Dimensions\";\nvar PixelRatio = function () {\n function PixelRatio() {\n _classCallCheck(this, PixelRatio);\n }\n _createClass(PixelRatio, null, [{\n key: \"get\",\n value: function get() {\n return Dimensions.get('window').scale;\n }\n }, {\n key: \"getFontScale\",\n value: function getFontScale() {\n return Dimensions.get('window').fontScale || PixelRatio.get();\n }\n }, {\n key: \"getPixelSizeForLayoutSize\",\n value: function getPixelSizeForLayoutSize(layoutSize) {\n return Math.round(layoutSize * PixelRatio.get());\n }\n }, {\n key: \"roundToNearestPixel\",\n value: function roundToNearestPixel(layoutSize) {\n var ratio = PixelRatio.get();\n return Math.round(layoutSize * ratio) / ratio;\n }\n }]);\n return PixelRatio;\n}();\nexport { PixelRatio as default };","map":{"version":3,"names":["Dimensions","PixelRatio","get","scale","fontScale","layoutSize","Math","round","ratio"],"sources":["/Users/thomaschazot/Documents/But2A/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/exports/PixelRatio/index.js"],"sourcesContent":["/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\nimport Dimensions from '../Dimensions';\n/**\n * PixelRatio gives access to the device pixel density.\n */\n\nexport default class PixelRatio {\n /**\n * Returns the device pixel density.\n */\n static get() {\n return Dimensions.get('window').scale;\n }\n /**\n * No equivalent for Web\n */\n\n\n static getFontScale() {\n return Dimensions.get('window').fontScale || PixelRatio.get();\n }\n /**\n * Converts a layout size (dp) to pixel size (px).\n * Guaranteed to return an integer number.\n */\n\n\n static getPixelSizeForLayoutSize(layoutSize) {\n return Math.round(layoutSize * PixelRatio.get());\n }\n /**\n * Rounds a layout size (dp) to the nearest layout size that corresponds to\n * an integer number of pixels. For example, on a device with a PixelRatio\n * of 3, `PixelRatio.roundToNearestPixel(8.4) = 8.33`, which corresponds to\n * exactly (8.33 * 3) = 25 pixels.\n */\n\n\n static roundToNearestPixel(layoutSize) {\n var ratio = PixelRatio.get();\n return Math.round(layoutSize * ratio) / ratio;\n }\n\n}"],"mappings":";;AASA,OAAOA,UAAU;AAAsB,IAKlBC,UAAU;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA,OAI7B,eAAa;MACX,OAAOD,UAAU,CAACE,GAAG,CAAC,QAAQ,CAAC,CAACC,KAAK;IACvC;EAAC;IAAA;IAAA,OAMD,wBAAsB;MACpB,OAAOH,UAAU,CAACE,GAAG,CAAC,QAAQ,CAAC,CAACE,SAAS,IAAIH,UAAU,CAACC,GAAG,EAAE;IAC/D;EAAC;IAAA;IAAA,OAOD,mCAAiCG,UAAU,EAAE;MAC3C,OAAOC,IAAI,CAACC,KAAK,CAACF,UAAU,GAAGJ,UAAU,CAACC,GAAG,EAAE,CAAC;IAClD;EAAC;IAAA;IAAA,OASD,6BAA2BG,UAAU,EAAE;MACrC,IAAIG,KAAK,GAAGP,UAAU,CAACC,GAAG,EAAE;MAC5B,OAAOI,IAAI,CAACC,KAAK,CAACF,UAAU,GAAGG,KAAK,CAAC,GAAGA,KAAK;IAC/C;EAAC;EAAA;AAAA;AAAA,SAnCkBP,UAAU"},"metadata":{},"sourceType":"module"} |