mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
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:
committed by
Facebook Github Bot
parent
ceb1d1ca5b
commit
114c258045
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user