-
Notifications
You must be signed in to change notification settings - Fork 245
fix: made the scrolling feature in snowflake effect #1502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Changes from all commits
7f41ce6
360374d
6abc751
7ad59c5
7a9345e
8e60e04
2e0ffbb
f55832f
c81c54b
d6c62b2
390acf7
452ede8
cb9ec5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,10 +5,34 @@ class SnowFlakeAnimation extends BadgeAnimation { | |||||
| void processAnimation(int badgeHeight, int badgeWidth, int animationIndex, | ||||||
| List<List<bool>> processGrid, List<List<bool>> canvas) { | ||||||
| int newWidth = processGrid[0].length; | ||||||
| int totalAnimationLength = badgeHeight * 16; | ||||||
| int frame = animationIndex % totalAnimationLength; | ||||||
| int newHeight = processGrid.length; | ||||||
|
|
||||||
| int horizontalOffset = (badgeWidth - newWidth) ~/ 2; | ||||||
| // Calculate the total number of frames that fit the badge width | ||||||
| int framesCount = (newWidth / badgeWidth).ceil(); | ||||||
|
|
||||||
| // Calculate the total animation length for one complete snowflake cycle | ||||||
| int snowflakeCycleLength = badgeHeight * 16; | ||||||
|
|
||||||
| // For transfer optimization: limit to 8 frames maximum | ||||||
| int maxFrames = 8; | ||||||
| int effectiveFramesCount = framesCount.clamp(1, maxFrames); | ||||||
|
|
||||||
| // Calculate the total length for one complete text scroll cycle | ||||||
| int totalCycleLength = snowflakeCycleLength * effectiveFramesCount; | ||||||
nope3472 marked this conversation as resolved.
Show resolved
Hide resolved
nope3472 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| // Get the current position in the overall cycle | ||||||
| int cyclePosition = animationIndex % totalCycleLength; | ||||||
|
|
||||||
| // Determine which text section we're currently showing | ||||||
|
||||||
| // Determine which text section we're currently showing | |
| // Determine which content frame we're currently showing |
sourcery-ai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
nope3472 marked this conversation as resolved.
Show resolved
Hide resolved
nope3472 marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,7 +131,7 @@ | |
| "up": "Up", | ||
| "down": "Down", | ||
| "fixed": "Fixed", | ||
| "animation": "Animation", | ||
| "animation": "Dot-Matrix", | ||
|
||
| "snowflake": "Snowflake", | ||
| "picture": "Picture", | ||
| "laser": "Laser", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,7 +147,7 @@ | |
| "failedToSaveBadge": "बैज सेव नहीं हुआ", | ||
| "save": "सेव करें", | ||
| "speed": "स्पीड", | ||
| "animation": "एनिमेशन", | ||
| "animation": "डॉट-मैट्रिक्स", | ||
|
||
| "effects": "इफेक्ट", | ||
| "transfer": "बैज पर भेजें", | ||
| "saveBadge": "बैज सेव करें", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.