BREAKING - Change aspect ratio to always be width/height

Summary:
@public

Aspect ratio being defined as width/height or height/width depending on the situation it was used in turned out to be very confusing. This diff makes aspect ratio always be defined as width/height irregardless of the usage.

Differential Revision: D4339132

fbshipit-source-id: e5da32750b55ddaf6acaf1cbd7662d86f2b480c3
This commit is contained in:
Emil Sjolander
2016-12-22 02:57:15 -08:00
committed by Facebook Github Bot
parent 3d10ba5f72
commit 071f576db9
3 changed files with 8 additions and 5 deletions

View File

@@ -351,7 +351,7 @@ TEST(YogaTest, aspect_ratio_double_main) {
const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 50);
YGNodeStyleSetAspectRatio(root_child0, 2);
YGNodeStyleSetAspectRatio(root_child0, 0.5);
YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
@@ -372,7 +372,7 @@ TEST(YogaTest, aspect_ratio_half_main) {
const YGNodeRef root_child0 = YGNodeNew();
YGNodeStyleSetWidth(root_child0, 100);
YGNodeStyleSetAspectRatio(root_child0, 0.5);
YGNodeStyleSetAspectRatio(root_child0, 2);
YGNodeInsertChild(root, root_child0, 0);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);