-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Dragging window to another display makes Icon show up incorrectly #677
Labels
rendering
Low level rendering
Comments
copybara-service bot
pushed a commit
to androidx/androidx
that referenced
this issue
May 25, 2021
(or other any component that uses DrawCache) Fixes JetBrains/compose-multiplatform#677 When density changes - the current size changes (for example, `previousDrawSize` is 200 and `size` is 100) and `drawCachedImage` calls. And when we call `drawCachedImage` - we call `clear` with this new passed size (100) instead of the size of bitmap (200). So the bitmap draws with the previous drawn content. Now we draw only part of the bitmap - with the passed to cache size. ``` import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material.Icon import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Refresh import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.Density import kotlinx.coroutines.delay @composable fun App() { var density by remember { mutableStateOf(2f) } LaunchedEffect(Unit) { delay(1000) density = 1f } Box(Modifier.fillMaxSize()) { CompositionLocalProvider(LocalDensity provides Density(density)) { Icon( imageVector = Icons.Default.Refresh, contentDescription = null ) } } } ``` Test: manual (see code above) Test: ./gradlew buildOnServer Change-Id: Ib4a1ec9037eefd355c27ffb871a0bd7ca0693b6b
Fixed in 0.4.0-build212 |
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When I drag the window from my main display (2560x1600) to my secondary one (2560 x 1440), the
Icon
composable is duplicated and is shown at another size. It looks fine when I drag it back to the first screen though.I'm on Compose version
0.4.0-build190
.MInimal repro code:
The text was updated successfully, but these errors were encountered: