When I reuse a painter in images of different size...
# compose
j
When I reuse a painter in images of different size... it breaks ? I would expect the
Image
to apply the
Modifier.size
, not the painter to change. Is this by design? A bug? Should I report it ?
l
Seems like a bug in the preview plugin. No idea how they handle this situation, but on Compose side this shouldn't be the result, as the image would
Fit
in whatever the size is.
c
Yes
Fit
is the default. Do you see this bug on rebuild of Preview? Might be a caching issue
And what version of Studio and Compose are you using?
j
I have got a even weirder behaviour. The preview as I described and in the emulator I got 3 images???
Copy code
kotlinCompilerExtensionVersion '1.4.4'
...
implementation platform('androidx.compose:compose-bom:2023.04.00')
...
    id 'com.android.application' version '8.0.0-rc01' apply false
    id 'com.android.library' version '8.0.0-rc01' apply false
    id 'org.jetbrains.kotlin.android' version '1.8.10' apply false
In case anyone wants to run it...
Copy code
Android Studio Flamingo | 2022.2.1 RC 1
Build #AI-222.4459.24.2221.9787799, built on March 21, 2023
Runtime version: 17.0.6+0-17.0.6b802.4-9586694 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.2.1
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 8
Metal Rendering is ON
Registry:
    external.system.auto.import.disabled=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    gradle.version.catalogs.dynamic.support=true

Non-Bundled Plugins:
    co.coscreen.coscreen-intellij-integration (1.0.7)
So, should I open a bug report or is it expected ?
c
This is definitely not expected. Please file a bug with the project you have here, as well as the logs generated from Help > Collect Logs and Diagnostic Data
j
c
Thank you!