Skip to content

vector: fix out-of-bounds double-to-int conversion

At least with Clang 18 on Chimera Linux, the out-of-bounds conversion causes the vector-sprite-sheet test to fail:

ok 1 /vector-sprite-sheet/sprites
ok 2 /vector-sprite-sheet/fallback
not ok /vector-sprite-sheet/scale-factor - shumate-FATAL-CRITICAL: shumate_vector_sprite_get_scale_factor: assertion 'SHUMATE_IS_VECTOR_SPRITE (self)' failed
Bail out!

best_scale is only used in the function are for comparisons against sprite_scale inside the for loop, and that variable is already a double anyway, so there is no good reason for best_scale to not be a double instead of an int.

Credits go to q66 for telling me about the proper fixhere.

Edited by triallax

Merge request reports

Loading