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

always increment quad, mesh, text and image layer counts in wgpu layer rendering #2701

Merged
merged 2 commits into from
Jan 26, 2025

Conversation

edwloef
Copy link
Contributor

@edwloef edwloef commented Dec 19, 2024

Fixes #2700

@hecrj hecrj added this to the 0.14 milestone Jan 26, 2025
@hecrj hecrj added bug Something isn't working rendering wgpu fix labels Jan 26, 2025
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just hit this bug. Pesky one!

Thanks 🙇

@hecrj hecrj enabled auto-merge January 26, 2025 02:43
@hecrj hecrj merged commit c0db7b8 into iced-rs:master Jan 26, 2025
15 checks passed
@hecrj
Copy link
Member

hecrj commented Jan 26, 2025

In fact, I believe we can just avoid preparing these layers altogether as a simpler fix:

3428a3d

@flakes
Copy link

flakes commented Feb 14, 2025

@hecrj These changes apparently broke the start_layer clipping when using draw_geometry in a custom widget. The clipping still works for text, but not rectangles:

Screenshot 2025-02-14 at 22 34 22

Notice how the text is clipped to the viewport of the custom widget, but the rectangles are drawn outside the widget, on top of the buttons.

Latest master with changes from this PR reverted:

Screenshot 2025-02-14 at 22 33 20

The widget code is here: https://github.com/syndicodefront/infekt/blob/3f15caa6fdc8aa381422a5a28340984de589fbb4/infekt-v2/src/gui/widget/enhanced_nfo_view.rs#L231

Am I abusing a bug here as a feature or is it a regression?

@edwloef
Copy link
Contributor Author

edwloef commented Feb 14, 2025

It seems like the changes made here were later refactored in 3428a3d, could that commit also be affecting things? I honestly have no idea.

@edwloef
Copy link
Contributor Author

edwloef commented Feb 14, 2025

At first glance, the replacement of scale with scale_factor in the refactoring commit looks suspicious to me. Maybe you could try switching that out and see if it fixes your issue?

@hecrj
Copy link
Member

hecrj commented Feb 14, 2025

@flakes Fixed in 7c54bde.

@flakes
Copy link

flakes commented Feb 15, 2025

@hecrj confirming it works, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix rendering wgpu
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Layer rendering breaks if one is not drawn at any point
3 participants