LibGui icon indicating copy to clipboard operation
LibGui copied to clipboard

Animated WSprite never displays the last frame

Open fin444 opened this issue 3 years ago • 0 comments

Describe the bug WSprites with multiple frames never render the last frame.

To Reproduce Steps to reproduce the behavior:

  1. Create a WSprite with an animation.
  2. Look at it.

Version of the (please complete the following information):

  • Mod: 5.2.0+1.18
  • Fabric API: 0.44.0+1.18
  • Minecraft: 1.18.1

Additional context This may be caused by the following if statement: https://github.com/CottonMC/LibGui/blob/bfdde6ea3623783f1c87b14fad76b6d4c465aeab/src/main/java/io/github/cottonmc/cotton/gui/widget/WSprite.java#L205 It goes back to the 0th frame immediately if the currentFrame is the last frame, rather than one greater than the last frame.

fin444 avatar Jan 12 '22 19:01 fin444