fix: anim out of bounds (#283)

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker
2025-07-22 15:09:53 -03:00
committed by GitHub
parent 0e51a48858
commit bb3b380a18

View File

@@ -289,7 +289,7 @@ func (a Anim) View() string {
var b strings.Builder
for i := range a.width {
switch {
case !a.initialized && time.Since(a.startTime) < a.birthOffsets[i]:
case !a.initialized && i < len(a.birthOffsets) && time.Since(a.startTime) < a.birthOffsets[i]:
// Birth offset not reached: render initial character.
b.WriteString(a.initialFrames[a.step][i])
case i < a.cyclingCharWidth: