Skip to content

Commit 5567aa0

Browse files
committed
Fix Fit.LAYOUT artboard oversized on Android
Set layoutScaleFactorAutomatic to device density at init time. Defaults to 1.0 and onMeasure may not fire before the render thread uses it. Fixes #206
1 parent 950026c commit 5567aa0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

android/src/main/java/com/rive/RiveReactNativeView.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ class RiveReactNativeView(context: ThemedReactContext) : FrameLayout(context) {
8181

8282
init {
8383
riveAnimationView = ReactNativeRiveAnimationView(context)
84+
// https://github.com/rive-app/rive-nitro-react-native/pull/209
85+
riveAnimationView.layoutScaleFactorAutomatic = resources.displayMetrics.density
8486
addView(riveAnimationView)
8587
}
8688

0 commit comments

Comments
 (0)