Skip to content

fix: resolve text clipping and animation lookup issues #1796#1801

Closed
xar43 wants to merge 8 commits into
fossasia:developmentfrom
xar43:fix-animation-1796
Closed

fix: resolve text clipping and animation lookup issues #1796#1801
xar43 wants to merge 8 commits into
fossasia:developmentfrom
xar43:fix-animation-1796

Conversation

@xar43

@xar43 xar43 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Closes #1796

Fix "Fixed" Animation Bug

This PR fixes the issue where the Fixed animation doesn't behave as expected. Instead of remaining fixed, it can clip the text and may even get transferred as the Splitting animation.

What was causing the issue?

The app was identifying the selected animation by comparing object instances (==). This works only when the exact same instance is reused. If a new instance of the same animation class is created, the comparison fails, causing the app to fall back to the wrong animation during transfer.

What's changed?

I updated lib/badge_animation/animation_abstract.dart to make animation comparisons based on the animation type instead of object identity.

By overriding == and hashCode in the BadgeAnimation base class to compare runtimeType, different instances of the same animation (for example, two FixedAnimation objects) are now treated as equal.

This ensures the correct animation is recognized and transferred, preventing the unexpected fallback behavior.

WhatsApp.Video.2026-07-07.at.1.10.01.AM.mov

xar43 added 8 commits June 25, 2026 17:28
- Add BadgeLoaderHelper.isLegacyBadge() to detect badges missing
  original text (created before BadgeTextStorage was introduced)
- Show AlertDialog on edit attempt for legacy badges, offering a
  'Create New' option instead of opening a broken editor session
- Add legacyBadgeTitle, legacyBadgeMessage and createNew keys to
  app_en.arb for full i18n support

Closes fossasia#1769
- importBadgeData: Do not fallback to filename if originalText is missing. Save empty string to correctly flag the badge as legacy.

- importBadgeFromJson: Restore embedded custom cliparts and save originalText for badges imported via QR code.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @xar43, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@xar43 xar43 closed this Jul 6, 2026
@ctrlVnt ctrlVnt requested review from bhavjsh and rahul31124 July 6, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Fixed animation is not fixed

1 participant