From a03d0a59c01e24dad52ab1fd04401387aceec72d Mon Sep 17 00:00:00 2001 From: Ivan Matkov Date: Thu, 13 Jun 2024 15:51:19 +0200 Subject: [PATCH] Allow paint before showing (#941) Fix compose tests after #923 --- skiko/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/skiko/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt b/skiko/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt index 3e7fda6ec..fca23000c 100644 --- a/skiko/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt +++ b/skiko/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt @@ -335,15 +335,13 @@ actual open class SkiaLayer internal constructor( // // Please note that calling redraw during layout might break software renderers, // so applying this fix only for Direct3D case. - if (renderApi == GraphicsApi.DIRECT3D) { + if (renderApi == GraphicsApi.DIRECT3D && isShowing) { redrawer?.syncSize() tryRedrawImmediately() } } private fun tryRedrawImmediately() { - if (!isShowing) return - // It might be called inside `renderDelegate`, // so to avoid recursive call (not supported) just schedule redrawing. //