mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-25 04:45:47 +08:00
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:
committed by
Facebook Github Bot
parent
dec81781cd
commit
86c50a5094
@@ -3322,7 +3322,7 @@ float YGRoundValueToPixelGrid(const float value,
|
||||
scaledValue = scaledValue - fractial;
|
||||
} else {
|
||||
// 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user