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:
committed by
Facebook Github Bot
parent
3d10ba5f72
commit
071f576db9
@@ -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);
|
||||
|
Reference in New Issue
Block a user