Skip to content

Commit 114c258

Browse files
sherginfacebook-github-bot
authored andcommittedFeb 6, 2018
Enabling round-to-pixel Yoga feature for RN (iOS)
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
1 parent ceb1d1c commit 114c258

File tree

4 files changed

+1
-2
lines changed

4 files changed

+1
-2
lines changed
 

‎React/Views/RCTShadowView.m

+1-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ + (YGConfigRef)yogaConfig
5050
static dispatch_once_t onceToken;
5151
dispatch_once(&onceToken, ^{
5252
yogaConfig = YGConfigNew();
53-
// Turnig off pixel rounding.
54-
YGConfigSetPointScaleFactor(yogaConfig, 0.0);
53+
YGConfigSetPointScaleFactor(yogaConfig, RCTScreenScale());
5554
YGConfigSetUseLegacyStretchBehaviour(yogaConfig, true);
5655
});
5756
return yogaConfig;

0 commit comments

Comments
 (0)
Please sign in to comment.