Skip to content

Commit

Permalink
Enabling round-to-pixel Yoga feature for RN (iOS)
Browse files Browse the repository at this point in the history
Summary:
This change enables built-in Yoga mechanism which rounds producing layout metrics to closest "pixel" values.
See previous diff for more context.

Reviewed By: fkgozali

Differential Revision: D6889762

fbshipit-source-id: bc2eea44704db4b377e2e14fab9f67be8c935719
  • Loading branch information
shergin authored and facebook-github-bot committed Feb 6, 2018
1 parent ceb1d1c commit 114c258
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions React/Views/RCTShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ + (YGConfigRef)yogaConfig
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
yogaConfig = YGConfigNew();
// Turnig off pixel rounding.
YGConfigSetPointScaleFactor(yogaConfig, 0.0);
YGConfigSetPointScaleFactor(yogaConfig, RCTScreenScale());
YGConfigSetUseLegacyStretchBehaviour(yogaConfig, true);
});
return yogaConfig;
Expand Down

0 comments on commit 114c258

Please sign in to comment.