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

[DrawablePainter] Fix overwriting bounds of drawable when drawing it via DrawablePainter #1322

Merged
merged 1 commit into from Sep 5, 2022

Conversation

int02h
Copy link
Contributor

@int02h int02h commented Sep 5, 2022

This PR fixes the bug when DrawablePainter overwrites bounds of the drawable instance when drawing it. It leads to incorrect behaviour of content scaling of Image.

@brunopiovan-dominos
Copy link

when the drawable is AdaptiveIconDrawable, it gets rendered too big, ignoring its bounds or size passed through a modifier, to work around this issue I convert it to a BitmapDrawable like so:

iconDrawable = service.loadIcon(pm).let {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && it is AdaptiveIconDrawable) {
        BitmapDrawable(context.resources, it.toBitmap())
    } else {
        it
    }
},

not sure if this issue should be considered in the library

@natanfudge
Copy link

natanfudge commented Sep 26, 2022

After 0.26.3-beta (presumably this commit), some images no longer expand to fit when using ContentScale.Fit.
Surely if I specify ContentScale.Fit, the library should overwrite the bounds of the drawable to be the same as the bounds of component?

@gajicm93
Copy link

gajicm93 commented Oct 7, 2022

After 0.26.3-beta (presumably this commit), some images no longer expand to fit when using ContentScale.Fit.
Surely if I specify ContentScale.Fit, the library should overwrite the bounds of the drawable to be the same as the bounds of component?

I also moved from v0.25.1 now to v0.26.5-rc, and DrawablePainter now completely ignores BOTH ContentScale and Alignment set on the Image.. It only follows its own intrinsic size.

@andkulikov
Copy link
Collaborator

The change 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

Successfully merging this pull request may close these issues.

None yet

5 participants