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:
Chandra Patni 2017-11-01 15:42:41 -07:00 committed by Facebook Github Bot
parent dec81781cd
commit 86c50a5094
1 changed files with 1 additions and 1 deletions

View File

@ -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;
} }