[2.0.77] util.combine_icons has shift and scale issues

Post your bugs and problems so we can fix them.
User avatar
PennyJim
Fast Inserter
Fast Inserter
Posts: 171
Joined: Wed Jan 18, 2023 3:49 am
Contact:

[2.0.77] util.combine_icons has shift and scale issues

Post by PennyJim »

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):

Code: Select all

icon.shift = util.add_shift(shift, util.mul_shift(icon_to_add.shift, scale))
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.
Post Reply

Return to “Bug Reports”