slysnivy / Soup_Arcade

A repository dedicated to showcasing games, visual aides, and other projects that I have cooked up 🧑‍🍳
Apache License 2.0
1 stars 0 forks source link

Botaneer Issue 1 - Zooming ruining grid/pot creation positioning #2

Closed slysnivy closed 1 year ago

slysnivy commented 1 year ago

Whenever a zoom is used at different positions (relative to the pot grid), some grid lines will become misaligned. I outlined a possible fix in Botaneer patch 2 (#3), where rounding the decimal from the x and y positioning after centralization may keep a consistent integer each time. This can be accomplished by using math.ceil or math.floor to always round up/down values.

slysnivy commented 1 year ago

After looking it over, it actually seems like an issue from the inverse_scaling method where it multiplies each rect property with a decimal. Therefore, the fix is to use math.ceil/floor before the scaling is applied to the x and y positioning directly, not the centralization calculations.