mirror of
https://github.com/charmbracelet/crush.git
synced 2025-08-02 05:20:46 +03:00
fix: anim out of bounds (#283)
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
0e51a48858
commit
bb3b380a18
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user