desktop: correct animated image comments

This commit is contained in:
Narasimha-sc
2026-08-12 15:00:06 +00:00
parent 63ee35aec9
commit c03b17b167
2 changed files with 2 additions and 2 deletions
@@ -142,7 +142,7 @@ private suspend fun playFrames(codec: Codec, blurred: State<Boolean>?, showFrame
// busy machine should not turn a cheap animation into a still. Expensive ones overrun every frame.
if (System.nanoTime() - startedDecoding > MAX_FRAME_DECODE_MS * 1_000_000) slowFrames++ else slowFrames = 0
if (slowFrames >= 2) {
Log.d(TAG, "Animation too expensive to decode, keeping the still image")
Log.d(TAG, "Animation too expensive to decode, stopping on this frame")
return
}
// A new wrapper around the same raster, so the state sees a change - as the video surface does.
@@ -19,7 +19,7 @@ actual fun SimpleAndAnimatedImageView(
blurred: State<Boolean>,
ImageView: @Composable (painter: Painter, onClick: () -> Unit) -> Unit
) {
// The small view is the chat list preview: a 36dp box that the desktop layout keeps on screen the whole
// The small view is the chat list preview: a 36sp box that the desktop layout keeps on screen the whole
// time. Decoding an animation at its own resolution to fill it would hold a raster and spend a frame of
// work per listed chat, without pause, so it keeps the still image as it did before.
val frame = if (smallView) null else rememberAnimatedImage(data, imageBitmap, blurred)