Skip to content

Commit

Permalink
Merge pull request facebook#73 from gunnigylfa/add-pixel-ratio-api
Browse files Browse the repository at this point in the history
Add PixelRatio bindings
  • Loading branch information
wokalski authored Sep 24, 2017
2 parents bbe0905 + 0a38b71 commit c28b291
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pixelRatioRe.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
external get : unit => float = "get" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"];

external getFontScale : unit => float = "getFontScale" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"];

external getPixelSizeForLayoutSize : int => int = "getPixelSizeForLayoutSize" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"];

external roundToNearestPixel : float => float = "roundToNearestPixel" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"];
7 changes: 7 additions & 0 deletions src/pixelRatioRe.rei
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
let get: unit => float;

let getFontScale: unit => float;

let getPixelSizeForLayoutSize: int => int;

let roundToNearestPixel: float => float;
2 changes: 2 additions & 0 deletions src/reactNative.re
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ module NativeEventEmitter = NativeEventEmitterRe;

module Platform = PlatformRe;

module PixelRatio = PixelRatioRe;

module StyleSheet = StyleSheetRe;

module PanResponder = {
Expand Down

0 comments on commit c28b291

Please sign in to comment.