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

Container shadows are inconsistent between wgpu and tiny-skia with custom theme #2339

Open
2 tasks done
mtkennerly opened this issue Mar 19, 2024 · 2 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@mtkennerly
Copy link
Contributor

mtkennerly commented Mar 19, 2024

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?

I have a custom theme where the Container appearance includes:

            shadow: Shadow {
                color: Color::BLACK,
                offset: Vector::ZERO,
                blur_radius: 0.0,
            }

With wgpu, there is no visible shadow. With tiny-skia, black fills whole container.

I can work around it by using Color::TRANSPARENT.

Gist (using red shadow for illustration purposes): https://gist.github.com/mtkennerly/993c3fbdd7ea770c0c28d268cf063664

ICED_BACKEND=wgpu cargo run

Screenshot 2024-03-18 234327

ICED_BACKEND=tiny-skia cargo run

Screenshot 2024-03-18 234342

What is the expected behavior?

The wgpu and tiny-skia examples should look the same.

Version

crates.io release

Operating System

Windows

Do you have any log output?

No response

@mtkennerly mtkennerly added the bug Something isn't working label Mar 19, 2024
@mtkennerly mtkennerly changed the title Container shadows are wrong size with tiny-skia and custom theme Container shadows are inconsistent between wgpu and tiny-skia with custom theme Mar 19, 2024
@njust
Copy link

njust commented Mar 30, 2024

Hi, I have the same Issue, but wanted to add, that for buttons shadows work fine also with the tiny-skia backend:

Wgpu backend
image

Tiny-skia backend
image

What do you mean by "can work around it by using Color::TRANSPARENT."? Using Color::TRANSPARENT for the shadow effectively means no visible shadow. So the workaround for the tiny-skia backend is not using shadows at all?

@mtkennerly
Copy link
Contributor Author

So the workaround for the tiny-skia backend is not using shadows at all?

My use case is without any shadows, but yeah, that doesn't help if you actually want them 😅

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

No branches or pull requests

2 participants