[posila] [0.17.25] Alt-info layered icon scaling issues

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
OkraDonkey
Burner Inserter
Burner Inserter
Posts: 13
Joined: Sat Dec 16, 2017 1:24 pm
Contact:

Re: [posila] [0.17.25] Alt-info layered icon scaling issues

Post by OkraDonkey »

posila wrote:
Mon Jun 10, 2019 1:00 pm
So, after thinking about it more, I decided to declare the current system as good enough.

There is no real reason for us to ever change internally expected sizes, we will just change icon_size in lua as everyone else, so having to know that the icon will be rescaled so that the first layer is 32x32px is not as big of a deal as I thought.
I'd like to add one piece of information that I learned recently. The alt-mode icon background (this thing) that provides contrast for recipe icons on buildings apparently only uses the non-transparent mask of the base layer of an icons{} stack to generate its dark background. If you use a blank (0% alpha) png for your 32x32 base layer, the background won't appear at all. Of course, if you don't use a base layer and your first icon is scaled, you'll encounter the aforementioned scaling problems in the crafting menu.

I've recreated Heavy Oil Cracking and Light Oil Cracking recipes (pictured below) using icons{} stacks to demonstrate what I'm talking about. The Heavy Oil Cracking icons{} has a transparent 32x32 base layer, so it scales correctly in the crafting menu, but it's missing the dark alt-mode background on the chemical plant. The Light Oil Cracking icons{} doesn't have a 32x32 base icon layer, so it suffers the scaling issue, but keeps its alt-mode background (although you may notice the background is only fitted to the light oil sub-icon, not the petrol sub-icons).
Icons.png
Icons.png (604.22 KiB) Viewed 665 times
As a compromise solution, I created a generic white oval shape on a blank 32x32 background, then set the oval's alpha to 1%. Using this almost-blank-oval.png as the base layer of the icons{} stack prevents the crafting-icon scaling problem while still providing a suitable generic oval mask on which the alt-mode icon background feature can build its dark background.

Of course, the dark background won't be customized to the shape of the composite icon, but the result was hardly noticeable in my testing. If a particular composite icon needed special treatment (like a thin horizontal shape, for instance), a custom base layer png could be created, consisting of a 1% alpha mask in the shape of the desired composite icon.

I suppose someone could request an update to the alt-mode-background algorithm to consider the non-transparent mask of the entire icons{} stack instead of just the base layer, but I'm not sure this warrants a bug report or feature request, especially when there's a decent compromise solution.

Post Reply

Return to “Minor issues”