Lommix / bevy_aseprite_ultra

The ultimate bevy aseprite binary plugin. Featuring animations and static atlas loading with pivots. Full support for hot reloading!
MIT License
35 stars 10 forks source link

fix: clamp current_frame to be within active tag range #4

Closed onelson closed 6 months ago

onelson commented 6 months ago

Not ideal, but partially solves https://github.com/Lommix/bevy_aseprite_ultra/issues/3

By clamping the value for current_frame to the active tag's frame range, we can allow systems to directly manipulate the tag field on an Animation component without causing the animation playback to cover frames that are outside the range for the given tag.

This is a more conservative fix than I first hacked together (cf. https://github.com/Lommix/bevy_aseprite_ultra/issues/3#issuecomment-2106128700).

Still not great. At the very least it saves from leaking AnimationState which can now stay private.

Lommix commented 6 months ago

I understand the Problem you are solving and agree with the current solution for now. I'll merge it and release a new subversion.