-
Notifications
You must be signed in to change notification settings - Fork 69
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
Rect::round_out
is either incorrect or documented wrong
#114
Comments
Hm... I'm not sure what is the correct result here should be. |
And of course it affects rendering, which makes it even more complicated. |
Even worse, it somehow causes a different output each time... Will take a closer look later. |
I believe the goal of Also, I looked at IntRect::from_ltrb(
orig.left().floor() as i32,
orig.top().floor() as i32,
orig.right().ceil() as i32,
orig.bottom().ceil() as i32,
) Checks for overflowing |
Yes, we should switch the current implementation to
Patches are welcome. tiny-skia is 16 KLOC. There would always be ways to improve it. |
The documentation claims that this function:
However, the following code prints
Some(IntRect { x: 1, y: 1, width: 2, height: 2 })
which is rounding the right and bottom edges inwards:src/scan/path_aa.rs
uses the "correct" implementation and calls out thatRect::round_out
returns the wrong result.I would suggest that the current implementation is useless, and replace it with the one from
path_aa.rs
that actually rounds out.The text was updated successfully, but these errors were encountered: