From ec22448facf2d19d9695c307a6bab2a4abd833e9 Mon Sep 17 00:00:00 2001 From: Aleksey Zinchenko Date: Fri, 9 Feb 2018 22:08:29 +0530 Subject: [PATCH] Round values to .01 accuracy --- yoga/Yoga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yoga/Yoga.c b/yoga/Yoga.c index 398d377490..89ce48a53e 100644 --- a/yoga/Yoga.c +++ b/yoga/Yoga.c @@ -3162,7 +3162,7 @@ static float YGRoundValueToPixelGrid(const float value, const float pointScaleFactor, const bool forceCeil, const bool forceFloor) { - float scaledValue = value * pointScaleFactor; + float scaledValue = roundf(value * pointScaleFactor * 100) / 100; float fractial = fmodf(scaledValue, 1.0); if (YGFloatsEqual(fractial, 0)) { // Still remove fractial as fractial could be extremely small.