From 342c6da8df2a3b953ce4adefbc0b31ee430ea792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Mon, 13 Apr 2026 11:51:21 +0200 Subject: [PATCH] Initialize layoutScaleFactorAutomatic to device density The default of 1.0 means resizeArtboard() computes pixel dimensions instead of dp if it runs before onMeasure. iOS initializes scale factor at view init time; this matches that behavior. Fixes #446 (issue 1) --- .../src/main/java/app/rive/runtime/kotlin/RiveAnimationView.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/kotlin/src/main/java/app/rive/runtime/kotlin/RiveAnimationView.kt b/kotlin/src/main/java/app/rive/runtime/kotlin/RiveAnimationView.kt index 8d1a31bd..3e1c8186 100644 --- a/kotlin/src/main/java/app/rive/runtime/kotlin/RiveAnimationView.kt +++ b/kotlin/src/main/java/app/rive/runtime/kotlin/RiveAnimationView.kt @@ -393,6 +393,7 @@ open class RiveAnimationView(context: Context, attrs: AttributeSet? = null) : loop = rendererAttributes.loop, autoplay = rendererAttributes.autoplay, ) + controller.layoutScaleFactorAutomatic = resources.displayMetrics.density /** * Attach the observer to give us lifecycle hooks. *