Prevent recursion in ImageLayerDataModel fade out animator
@@ -114,7 +114,7 @@ class ImageLayerDataModel(
renderCommand?.let { it(canvas) }
}
- fun reset() {
+ fun reset(endAnimator: Boolean = false) {
canvasTransformationHandler.canvasTransformation = null
dataModel?.apply {
onDetach()
@@ -127,7 +127,11 @@ class ImageLayerDataModel(
currentBounds = null
paint.reset()
colorFilter = null
+
+ if (!endAnimator) {
+ // To prevent recursion (T134570663)
fadeAnimator?.end()
+ }
fadeAnimator = null
}
@@ -160,7 +164,7 @@ class ImageLayerDataModel(
addListener(
object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator) {
- reset()
+ reset(true)
}
})
}
