Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rounding of negative numbers #825

Closed
wants to merge 1 commit into from

Commits on Oct 9, 2018

  1. Fix rounding of negative numbers

    `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#824.
    
    Fixes facebook#824
    
    Adam Comella
    Microsoft Corp.
    Adam Comella committed Oct 9, 2018
    Configuration menu
    Copy the full SHA
    95c9b98 View commit details
    Browse the repository at this point in the history