Files
react-native/ReactCommon/fabric/core/layout
Valentin Shergin 791d0973cc Fabric: Making subprops of EmptyLayoutMetrics also empty/invalid
Summary:
This diff changes the value of `EmptyLayoutMetrics` to make it as unusual and useless as possible. This helps when we need to compare sub-values of `LayoutMetrics` to apply only changed ones.

For example, let say we need to make a transition between two `LayoutMetrics` values. Let's say the first (the source) one equals `EmptyLayoutMetrics`. In order to apply only changed part, we need to compare individual sub-values, like `frame` or `displayType`. Before this change, the default value of `borderWidth` was `{0, 0, 0, 0}`. So in case if the second (the destination) value is also `{0, 0, 0, 0}`, the operation will be skipped.
This is undesirable because all new values have to be applied anyway because `EmptyLayoutMetrics` designates that the actual previous values are unknowns.

This fixes some visual issues on iOS caused by this issue because recycled views sometimes have non-default layout values where the transition from `EmptyLayoutMetrics` to some arbitrary value skips some sub-values.

Reviewed By: JoshuaGross

Differential Revision: D17312176

fbshipit-source-id: 7f311baea202ec2662ca87be0ae0ae6c6dd42712
2019-09-11 18:29:22 -07:00
..
2019-07-23 03:23:11 -07:00