From ea841f3abb57c1744d7105d44239f033a767c4fe Mon Sep 17 00:00:00 2001 From: qlli Date: Fri, 6 Sep 2024 17:40:26 +0800 Subject: [PATCH] fix: Sprite Glide panics #319 --- sprite.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sprite.go b/sprite.go index 62778cb..5a78648 100644 --- a/sprite.go +++ b/sprite.go @@ -648,8 +648,11 @@ func (p *Sprite) goAnimateInternal(name string, ani *aniConfig, isBlocking bool) fromvalf = frameFrom tovalf = frameTo } else { - fromvalf = fromval.(float64) - tovalf = toval.(float64) + if ani.AniType != aniTypeGlide { + // glide animation, the type of value is vector2, not float + fromvalf = fromval.(float64) + tovalf = toval.(float64) + } } if ani.AniType == aniTypeFrame {