-
Notifications
You must be signed in to change notification settings - Fork 136
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
Text clipping artifacts #286
Comments
I did a little bit of investigation. This (naturally) doesn't apply to only text, I made a path with 2 linetos which worked (although I couldn't reproduce with a rectangle). This also doesn't need the sub-fragment, just the path on its own worked. And unsurprisingly, the new clipping boundary is a (16px by 16px) tile edge. It seems that the parts of the path in the left-most tile column affected by the path are still displayed. This seems likely to be an off-by-one error, I'm just not sure where. |
Nice! This was appearing in some Lottie animations but the scene complexity there made it difficult to track anything down. Narrowing this to a much smaller test case is exceptionally helpful. |
When the bounding boxes of a path and its clip are disjoint (i.e. they do not intersect) the result of their intersection is a negative rectangle. When calculating the intersection of the bboxes, the binning stage ensures that the bbox is non-negative. It then normalizes the coordinates to bin dimensions and rounds the top-left corner down to the neareast integer and the bottom-right corner up. However this rounding causes zero-area bounding boxes to have a non-zero area and sends the bottom-right corner to the placed in the next bin. This causes fully clipped out draw objects to be included in binning, with an incorrect clip bounding box that causes them to be erroneously drawn with partial clipping. `binning` now takes care around this logic to make sure that a zero-area intersected-bbox gets skipped and clipped out. `tile_alloc`, also takes care in its logic. Fixes linebender#286 and linebender#333
#335 fixes this bug. I added @Stumblinbear's repro code to a new test scene that demonstrates the problem and the fix. |
When the bounding boxes of a path and its clip are disjoint (i.e. they do not intersect) the result of their intersection is a negative rectangle. When calculating the intersection of the bboxes, the binning stage ensures that the bbox is non-negative. It then normalizes the coordinates to bin dimensions and rounds the top-left corner down to the neareast integer and the bottom-right corner up. However this rounding causes zero-area bounding boxes to have a non-zero area and sends the bottom-right corner to the placed in the next bin. This causes fully clipped out draw objects to be included in binning, with an incorrect clip bounding box that causes them to be erroneously drawn with partial clipping. `binning` now takes care around this logic to make sure that a zero-area intersected-bbox gets skipped and clipped out. `tile_alloc`, also takes care in its logic. Fixes linebender#286 and linebender#333
Please re-open if you still see this issue on main. |
It seems as though text overflowing a clipping layer doesn't work properly. I've added the following to the
animated_text
test scene, around the second "Animated text!" elementWhich results in many vertical bars clipping the text, instead of the remaining text being clipped in its entirety:
The text was updated successfully, but these errors were encountered: