[2.0.77] util.combine_icons has shift and scale issues
Posted: Sat May 30, 2026 10:38 pm
Similar to 133724, I was going through util.lua and spotted a couple problems with combine_icons.
1. It only seems to support the array format of shift. This can be fixed by doing this (after 133724 is resolved):
2. The default icon size and scale seems to be off. This is a harder to merge fix since I think the solution involves repurposing one of the parameters.
Currently, you pass "default_icon_size", which seems pointless because there's defines.default_icon_size (and I did double check all icons do default to 64). Which is actually used in the default scale calculation.. which is wrong.
I propose that parameter is changed to "expected_icon_size" and used for the scale calculation instead, so we can actually plug in the different values described in IconData::scale
There is some world where that should be a define, but considering the "for all else" nature of it, that seems problematic.
1. It only seems to support the array format of shift. This can be fixed by doing this (after 133724 is resolved):
Code: Select all
icon.shift = util.add_shift(shift, util.mul_shift(icon_to_add.shift, scale))
Currently, you pass "default_icon_size", which seems pointless because there's defines.default_icon_size (and I did double check all icons do default to 64). Which is actually used in the default scale calculation.. which is wrong.
I propose that parameter is changed to "expected_icon_size" and used for the scale calculation instead, so we can actually plug in the different values described in IconData::scale
There is some world where that should be a define, but considering the "for all else" nature of it, that seems problematic.