Skip to content

Commit 4951560

Browse files
fix: Behaviour change in the Snowflake animation
1 parent 7fdc94e commit 4951560

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/badge_animation/ani_snowflake.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ class SnowFlakeAnimation extends BadgeAnimation {
77
int newGridHeight = processGrid.length;
88
int newGridWidth = processGrid[0].length;
99

10+
// Calculate the total number of frames based on overflow
1011
int framesCount = (newGridWidth / badgeWidth).ceil();
1112

13+
// The current frame index
1214
int currentFrame = animationIndex % framesCount;
1315

16+
// Always left-align: start at column 0 for each frame, but fetch the right slice from processGrid
1417
int startCol = currentFrame * badgeWidth;
1518

1619
for (int i = 0; i < badgeHeight; i++) {
@@ -20,4 +23,4 @@ class SnowFlakeAnimation extends BadgeAnimation {
2023
}
2124
}
2225
}
23-
}
26+
}

0 commit comments

Comments
 (0)