Skip to content

Conversation

@theashraf
Copy link
Member

Fixes bug where theme_id was being reset when entering new states in the state machine.

Root cause: config.theme_id and active_theme_id were not kept in sync. When set_theme() was called, only active_theme_id was updated. During state transitions, the empty config.theme_id was used to create new configs, causing theme reset.

Changes:

  • Sync config.theme_id with active_theme_id in set_theme()
  • Clear both in reset_theme() and when clearing themes
  • Preserve theme_id in state transition config creation
  • Re-apply theme after load_animation() to handle cases where renderer was cleared
  • Remove redundant config.theme_id assignment in set_config()

Fixes bug where theme_id was being reset when entering new states in the state machine.

Root cause: config.theme_id and active_theme_id were not kept in sync. When set_theme() was called, only active_theme_id was updated. During state transitions, the empty config.theme_id was used to create new configs, causing theme reset.

Changes:
- Sync config.theme_id with active_theme_id in set_theme()
- Clear both in reset_theme() and when clearing themes
- Preserve theme_id in state transition config creation
- Re-apply theme after load_animation() to handle cases where renderer was cleared
- Remove redundant config.theme_id assignment in set_config()
@changeset-bot
Copy link

changeset-bot bot commented Oct 27, 2025

⚠️ No Changeset found

Latest commit: 1a89a7c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

📊 Benchmark Results

dotlottie-rs

Benchmark Change Confidence Interval Status
load_animation_data +4.09% [+3.45%, +4.64%] ⚡ Slight change
set_theme +0.06% [-0.14%, +0.38%] ✅ No change
animation_loop_no_frame_interpolation -0.11% [-2.79%, +2.61%] ✅ No change
state_machine_load -0.23% [-0.57%, +0.02%] ✅ No change
load_dotlottie_data -0.96% [-1.29%, -0.64%] ✅ No change
load_animation_path -1.05% [-1.38%, -0.72%] ✅ No change
animation_loop_frame_interpolation -1.35% [-3.73%, +1.46%] ✅ No change
state_machine_load_data -1.75% [-5.08%, +0.91%] ✅ No change
How to interpret these results
  • Change: Estimated performance difference (negative = faster, positive = slower)
  • Confidence Interval: 95% confidence bounds for the change
  • Regression: Lower bound > +5% (confidently slower)
  • Improvement: Upper bound < -5% (confidently faster)

Criterion uses statistical analysis to account for noise and provide reliable comparisons.

@theashraf theashraf merged commit 4c825b4 into main Oct 27, 2025
2 checks passed
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.

2 participants