From 1d94d14b1edb13bb2e16483d26ba08690025fa64 Mon Sep 17 00:00:00 2001 From: Alexei Anoshenko <2277098+anoshenko@users.noreply.github.com> Date: Thu, 1 Aug 2024 22:32:31 +0300 Subject: [PATCH] Update animationRun.go --- animationRun.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/animationRun.go b/animationRun.go index 5e2955d..5b6c4a2 100644 --- a/animationRun.go +++ b/animationRun.go @@ -96,6 +96,15 @@ func (animation *animationData) onAnimationEnd(view View, _ string) { if animation.view != nil { animationView := animation.view listener := animation.listener + + if value, ok := animation.properties[PropertyTag]; ok { + if props, ok := value.([]AnimatedProperty); ok { + for _, prop := range props { + animationView.setRaw(prop.Tag, prop.To) + } + } + } + animation.finish() if listener != nil { listener(animationView, animation, AnimationEndEvent) @@ -113,6 +122,15 @@ func (animation *animationData) onAnimationCancel(view View, _ string) { if animation.view != nil { animationView := animation.view listener := animation.listener + + if value, ok := animation.properties[PropertyTag]; ok { + if props, ok := value.([]AnimatedProperty); ok { + for _, prop := range props { + animationView.Set(prop.Tag, prop.To) + } + } + } + animation.finish() if listener != nil { listener(animationView, animation, AnimationCancelEvent)