Fix C# MeasureFunc test
Summary: Closes https://github.com/facebook/yoga/pull/533 Reviewed By: emilsjolander Differential Revision: D4962771 Pulled By: splhack fbshipit-source-id: 96919da73f0f35c027097259fa189b5658fb11b7
This commit is contained in:
committed by
Facebook Github Bot
parent
3db38f2a80
commit
7c324f058c
@@ -164,6 +164,14 @@ namespace Facebook.Yoga
|
|||||||
return MeasureOutput.Make(123.4f, 81.7f);
|
return MeasureOutput.Make(123.4f, 81.7f);
|
||||||
});
|
});
|
||||||
node.CalculateLayout();
|
node.CalculateLayout();
|
||||||
|
Assert.AreEqual(123.0f, node.LayoutWidth);
|
||||||
|
Assert.AreEqual(82.0f, node.LayoutHeight);
|
||||||
|
|
||||||
|
node = new YogaNode(new YogaConfig{PointScaleFactor = 0});
|
||||||
|
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
|
||||||
|
return MeasureOutput.Make(123.4f, 81.7f);
|
||||||
|
});
|
||||||
|
node.CalculateLayout();
|
||||||
Assert.AreEqual(123.4f, node.LayoutWidth);
|
Assert.AreEqual(123.4f, node.LayoutWidth);
|
||||||
Assert.AreEqual(81.7f, node.LayoutHeight);
|
Assert.AreEqual(81.7f, node.LayoutHeight);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user