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

Drawable Painter doesn't render vector drawables anymore #1343

Closed
ubuntudroid opened this issue Sep 19, 2022 · 3 comments
Closed

Drawable Painter doesn't render vector drawables anymore #1343

ubuntudroid opened this issue Sep 19, 2022 · 3 comments

Comments

@ubuntudroid
Copy link

ubuntudroid commented Sep 19, 2022

Describe the bug

Since 0.26.3-beta Drawable Painter doesn't render vector drawables.

To Reproduce (if applicable)

Steps to reproduce the behavior:

  1. Get a vector drawable
  2. Reference it in a Drawable Painter, e.g. like so:
                Image(
                    painter = rememberDrawablePainter(
                        drawable = AppCompatResources.getDrawable(LocalContext.current, R.drawable.vector)
                    ),
                    contentDescription = null,
                    contentScale = ContentScale.Inside,
                    modifier = Modifier
                        .height(32.dp)
                        .width(32.dp)
                        .align(Alignment.CenterHorizontally)
                )
  1. The Drawable won't be drawn, but the image bounding box is there.

Expected behavior (if applicable)

Vector drawables should be drawn, just like in the previous versions.

Screenshots? (if applicable)

image

Environment: (if applicable)

  • Android OS version: all Android versions as well as Compose preview in Android Studio
  • Device: all
  • Accompanist version: 0.26.3-beta

Additional context

This PR might be related to or even causing the issue: #1322

@bentrengrove
Copy link
Collaborator

Thanks for the report, I haven't been able to reproduce this. Could you possible attach a vector that doesn't work?

Also, out of interest, what about your vector means you have to use drawable painter rather than just rememberVectorPainter()?

My reproduce attempt:
Screen Shot 2022-09-19 at 6 45 15 pm

@ubuntudroid
Copy link
Author

ubuntudroid commented Sep 23, 2022

@bentrengrove the vector is nothing I can share publicly - can I somehow send it to you directly?

rememberVectorPainter() works just fine indeed. I'm still wondering why rememberDrawablePainter() seized to work with that release. 🤔

@andkulikov
Copy link
Collaborator

The change (#1322) was reverted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants