-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 #824. Fixes #824 Adam Comella Microsoft Corp. Pull Request resolved: #825 Reviewed By: priteshrnandgaonkar Differential Revision: D10282064 Pulled By: shergin fbshipit-source-id: 16ca966e6cb0cfc88b1dbf4ba31e7b1dbe1f2049
- Loading branch information
1 parent
b747286
commit 786ccdd
Showing
2 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters