Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rounding of negative numbers (#825)
Summary: `YGRoundValueToPixelGrid` currently rounds negative numbers incorrectly. For example: ``` YGRoundValueToPixelGrid(-2.2, 1.0, /* ceil */ false, /* floor */ true) = -2.0 ``` However, that operation is supposed to take the floor of the number so the result should acutally be `-3.0`. There's a detailed comment in `YGRoundValueToPixelGrid` about the fix and why it works. A symptom that manifested because of this bug is that text nodes could get smaller and smaller on each layout pass. For details see facebook/yoga#824. Fixes #824 Adam Comella Microsoft Corp. Pull Request resolved: facebook/yoga#825 Reviewed By: priteshrnandgaonkar Differential Revision: D10282064 Pulled By: shergin fbshipit-source-id: 16ca966e6cb0cfc88b1dbf4ba31e7b1dbe1f2049
- Loading branch information