b965d2d37cbe1fc2e0eb794ce7d047bf.json 3.38 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _Dimensions=_interopRequireDefault(require(\"../Dimensions\"));var PixelRatio=function(){function PixelRatio(){}PixelRatio.get=function get(){return _Dimensions.default.get('window').scale;};PixelRatio.getFontScale=function getFontScale(){return _Dimensions.default.get('window').fontScale||PixelRatio.get();};PixelRatio.getPixelSizeForLayoutSize=function getPixelSizeForLayoutSize(layoutSize){return Math.round(layoutSize*PixelRatio.get());};PixelRatio.roundToNearestPixel=function roundToNearestPixel(layoutSize){var ratio=PixelRatio.get();return Math.round(layoutSize*ratio)/ratio;};return PixelRatio;}();exports.default=PixelRatio;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-web/dist/exports/PixelRatio/index.js"],"names":["PixelRatio","get","Dimensions","scale","getFontScale","fontScale","getPixelSizeForLayoutSize","layoutSize","Math","round","roundToNearestPixel","ratio"],"mappings":"mKASA,iEAKA,GAAIA,CAAAA,UAAU,CAEd,UAAY,CACV,QAASA,CAAAA,UAAT,EAAsB,CAAE,CAKxBA,UAAU,CAACC,GAAX,CAAiB,QAASA,CAAAA,GAAT,EAAe,CAC9B,MAAOC,qBAAWD,GAAX,CAAe,QAAf,EAAyBE,KAAhC,CACD,CAFD,CAQAH,UAAU,CAACI,YAAX,CAA0B,QAASA,CAAAA,YAAT,EAAwB,CAChD,MAAOF,qBAAWD,GAAX,CAAe,QAAf,EAAyBI,SAAzB,EAAsCL,UAAU,CAACC,GAAX,EAA7C,CACD,CAFD,CASAD,UAAU,CAACM,yBAAX,CAAuC,QAASA,CAAAA,yBAAT,CAAmCC,UAAnC,CAA+C,CACpF,MAAOC,CAAAA,IAAI,CAACC,KAAL,CAAWF,UAAU,CAAGP,UAAU,CAACC,GAAX,EAAxB,CAAP,CACD,CAFD,CAWAD,UAAU,CAACU,mBAAX,CAAiC,QAASA,CAAAA,mBAAT,CAA6BH,UAA7B,CAAyC,CACxE,GAAII,CAAAA,KAAK,CAAGX,UAAU,CAACC,GAAX,EAAZ,CACA,MAAOO,CAAAA,IAAI,CAACC,KAAL,CAAWF,UAAU,CAAGI,KAAxB,EAAiCA,KAAxC,CACD,CAHD,CAKA,MAAOX,CAAAA,UAAP,CACD,CAxCD,EAFA,C","sourcesContent":["/**\n * Copyright (c) Nicolas Gallagher.\n * Copyright (c) Facebook, Inc. and its 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\nvar PixelRatio =\n/*#__PURE__*/\nfunction () {\n  function PixelRatio() {}\n\n  /**\n   * Returns the device pixel density.\n   */\n  PixelRatio.get = function get() {\n    return Dimensions.get('window').scale;\n  }\n  /**\n   * No equivalent for Web\n   */\n  ;\n\n  PixelRatio.getFontScale = function 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  PixelRatio.getPixelSizeForLayoutSize = function 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  PixelRatio.roundToNearestPixel = function roundToNearestPixel(layoutSize) {\n    var ratio = PixelRatio.get();\n    return Math.round(layoutSize * ratio) / ratio;\n  };\n\n  return PixelRatio;\n}();\n\nexport { PixelRatio as default };"]},"metadata":{},"sourceType":"script"}