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

Layer rendering breaks if one is not drawn at any point #2700

Open
4 tasks done
edwloef opened this issue Dec 18, 2024 · 0 comments · May be fixed by #2701
Open
4 tasks done

Layer rendering breaks if one is not drawn at any point #2700

edwloef opened this issue Dec 18, 2024 · 0 comments · May be fixed by #2701
Labels
bug Something isn't working

Comments

@edwloef
Copy link
Contributor

edwloef commented Dec 18, 2024

Is your issue REALLY a bug?

  • My issue is indeed a bug!
  • I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

If you have a layer that is not drawn either because it is fully outside of the application window, or because its snapped bounds have an area of zero, this breaks subsequent layer draws. This is because at

iced/wgpu/src/lib.rs

Lines 271 to 275 in f2c9b6b

let Some(physical_bounds) =
physical_bounds.intersection(&(layer.bounds * scale))
else {
continue;
};
and

iced/wgpu/src/lib.rs

Lines 277 to 279 in f2c9b6b

let Some(scissor_rect) = physical_bounds.snap() else {
continue;
};
rendering for those layers is skipped without updating the quad_layer, mesh_layer and text_layer indices.

Here is a video of this occuring in a real iced app:

2024-12-18.12-19-02.mp4

and the relevant lines in the source code of this app: https://github.com/generic-daw/generic-daw/blob/b5593615b46625cfde0f194d16582f15cc672d7a/src/generic_front/widget/track.rs#L56-L59

What is the expected behavior?

Layer rendering doesn't break when a layer is not visible.

Version

crates.io release

Operating System

Linux

Do you have any log output?

No response

@edwloef edwloef added the bug Something isn't working label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant