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)