use `> || YGFloatsEqual` instead of `>=` for computing round value to pixel grid
Reviewed By: emilsjolander Differential Revision: D6202484 fbshipit-source-id: bb80235452208caec388775574cc4f07bfd649c4
This commit is contained in:
parent
dec81781cd
commit
86c50a5094
|
@ -3322,7 +3322,7 @@ float YGRoundValueToPixelGrid(const float value,
|
||||||
scaledValue = scaledValue - fractial;
|
scaledValue = scaledValue - fractial;
|
||||||
} else {
|
} else {
|
||||||
// Finally we just round the value
|
// Finally we just round the value
|
||||||
scaledValue = scaledValue - fractial + (fractial >= 0.5f ? 1.0f : 0.0f);
|
scaledValue = scaledValue - fractial + (fractial > 0.5f || YGFloatsEqual(fractial, 0.5f) ? 1.0f : 0.0f);
|
||||||
}
|
}
|
||||||
return scaledValue / pointScaleFactor;
|
return scaledValue / pointScaleFactor;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue