react-native-macos/ReactCommon
Emil Sjölander ee6b0d6658 Fix aspect ratio when stretching with main axis margin (#834)
Summary:
I've noticed that when a child's size is determined by `align-items: stretch` in combination with `aspect-ratio` its size is wrongly calculated to account for margin in the main axis when there is more than enough space.

See playground: https://goo.gl/tgW6cD

I've yet to figure out exactly how to solve this but i've started by writing a failing test when can be seen in the first commit here.

I assumed I had found the bug here https://github.com/facebook/yoga/blob/master/yoga/Yoga.cpp#L1838 where margin is being subtracted from the desired width even though the measure mode tells it to measure to exactly that size. However, if we don't remove this margin from the available width then 15 tests fail (including the one I just added) not quite figured out why yet. I'm also a bit confused at to why this would only happen for nodes with `aspect-ratio` and not for nodes where an explicit height and width is set.
Pull Request resolved: https://github.com/facebook/yoga/pull/834

Reviewed By: astreet

Differential Revision: D13223579

Pulled By: davidaurelio

fbshipit-source-id: 6970e6072e79f3bb6f9097355ab6e441441bfd88
2018-12-10 09:23:01 -08:00
..
config xplat: added ReactNativeConfig to access runtime specific config values 2018-12-05 15:03:27 -08:00
cxxreact Back out "Check for thread consistency in JSCRuntime" 2018-12-05 16:59:31 -08:00
fabric Buildify xplat build files. 2018-12-08 13:18:23 -08:00
jsi Back out "Check for thread consistency in JSCRuntime" 2018-12-05 16:59:31 -08:00
jsiexecutor Delete dead code 2018-12-04 12:01:59 -08:00
jsinspector RN: Missing Copyright Headers 2018-10-31 01:37:26 -07:00
microprofiler Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
yoga Fix aspect ratio when stretching with main axis margin (#834) 2018-12-10 09:23:01 -08:00
.clang-format Fabric: Enabling clang-format for the rest of Fabric 2018-10-09 16:31:48 -07:00