Browse files

Enabling round-to-pixel Yoga feature for RN (iOS)

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 114c258045ccca3a4433de206c7983b42d14c03b
@@ -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;

0 comments on commit 114c258

Please sign in to comment.