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

Account for floating point inaccuracies #273

Open
wfdewith opened this issue Feb 13, 2025 · 0 comments
Open

Account for floating point inaccuracies #273

wfdewith opened this issue Feb 13, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@wfdewith
Copy link
Contributor

Currently, we calculate aggregated advances based on their component advances, such as line advances being a sum of run advances and inline box widths, and run advances being a sum of cluster advances. All of these advances, including the aggregates, are always f32, which means that inaccuracies may occur based on the order in which the component advances are being added. See this for an example of the problem.

This is generally not a problem since those inaccuracies are very small, but it does pose a problem for invariants such as layout.width <= layout.max_content_width as discovered in #259.

@tomcur offered a suggestion in #259, but I wanted to move discussion to a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant