Skip to content

Commit c28b291

Browse files
authored
Merge pull request facebook#73 from gunnigylfa/add-pixel-ratio-api
Add PixelRatio bindings
2 parents bbe0905 + 0a38b71 commit c28b291

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/pixelRatioRe.re

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
external get : unit => float = "get" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"];
2+
3+
external getFontScale : unit => float = "getFontScale" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"];
4+
5+
external getPixelSizeForLayoutSize : int => int = "getPixelSizeForLayoutSize" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"];
6+
7+
external roundToNearestPixel : float => float = "roundToNearestPixel" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"];

src/pixelRatioRe.rei

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
let get: unit => float;
2+
3+
let getFontScale: unit => float;
4+
5+
let getPixelSizeForLayoutSize: int => int;
6+
7+
let roundToNearestPixel: float => float;

src/reactNative.re

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ module NativeEventEmitter = NativeEventEmitterRe;
8484

8585
module Platform = PlatformRe;
8686

87+
module PixelRatio = PixelRatioRe;
88+
8789
module StyleSheet = StyleSheetRe;
8890

8991
module PanResponder = {

0 commit comments

Comments
 (0)