diff --git a/element-view/src/jsMain/kotlin/ElementViewAdapter.kt b/element-view/src/jsMain/kotlin/ElementViewAdapter.kt index 6bac07b2..ad3d5d03 100644 --- a/element-view/src/jsMain/kotlin/ElementViewAdapter.kt +++ b/element-view/src/jsMain/kotlin/ElementViewAdapter.kt @@ -80,11 +80,11 @@ public class ElementViewAdapter( if (state.width == 0 || state.height == 0) return@collectLatest dataSource.collect { data -> updater.update(state.root, state.width.toFloat(), state.height.toFloat(), data) - window.awaitAnimationFrame() val canvas = HtmlKanvas(state.view, state.scale) canvas.context.clearRect(0.0, 0.0, state.width.toDouble(), state.height.toDouble()) state.root.draw(canvas) canvas.context.resetTransform() + window.awaitAnimationFrame() } } }