geode-sdk / cli

Command-line utilities for working w/ geode
Boost Software License 1.0
24 stars 21 forks source link

Fix spritesheets not supporting single image #48

Closed Prevter closed 6 months ago

Prevter commented 6 months ago

Issue lies is an oversight with how max_width is calculated. When having only a single image, it equals the largest_size and that leads to this particular if statement being skipped.

As a result, TexturePacker was trying to fit (for example) a 64x64 image, with max_width being 64. This, and the fact that default TexturePackerConfig has texture_padding set to 2 leads to an error message TextureTooLargeToFitIntoAtlas.

Tested different scenarios, including 127x128 and 128x127 images, with no issues detected.