Skip to content

Commit

Permalink
Round values to .01 accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
zintus committed Feb 9, 2018
1 parent 79e294c commit ec22448
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yoga/Yoga.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ec22448

Please sign in to comment.