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
This commit is contained in:
Valentin Shergin 2018-02-05 22:15:41 -08:00 committed by Facebook Github Bot
parent ceb1d1ca5b
commit 114c258045
4 changed files with 1 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -50,8 +50,7 @@ typedef NS_ENUM(unsigned int, meta_prop_t) {
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;