Skip to content

Commit

Permalink
debug: rn-hole-view fix long conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Sep 15, 2024
1 parent b0e55f2 commit 5b51e12
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions patches/RNHoleViewManagerImpl.kt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- /tmp/tmp-status-mobile-50163c946/tmp.83wZfl1Ekd/RNHoleViewManagerImpl.kt 2024-09-15 12:48:24.891269000 +0530
+++ ./node_modules/react-native-hole-view/android/src/main/java/com/ibitcy/react_native_hole_view/RNHoleViewManagerImpl.kt 2024-09-15 12:49:23.636288603 +0530
@@ -15,6 +15,7 @@
import com.ibitcy.react_native_hole_view.events.AnimFinishEvent

import kotlin.math.roundToInt
+import kotlin.math.roundToLong

class RNHoleViewManagerImpl(reactContext: ReactApplicationContext) {

@@ -29,7 +30,9 @@
if (animation != null) {
var duration = RNHoleView.ANIMATION_DURATION_DEFAULT
if (animation.hasKey("duration")) {
- duration = animation.getDouble("duration").toLong()
+ val durationDouble = animation.getDouble("duration")
+ // to avoid Loss of Precision errors
+ duration = durationDouble.roundToLong()
}
var timingFunction: RNHoleView.EAnimationTimingFunction? = null
if (animation.hasKey("timingFunction")) {

0 comments on commit 5b51e12

Please sign in to comment.