Page 1 of 1

strange icons behaviour

Posted: Sun Jun 02, 2019 12:03 am
by bobingabout
I defined an icons as follows:

Code: Select all

    icons =
    {
      {
        icon = "__base__/graphics/icons/fluid/sulfuric-acid.png",
        icon_size = 32,
        scale = 0.625,
        shift = {-6, -6}
      },
      {
        icon = "__bobplates__/graphics/icons/nitric-acid.png",
        icon_size = 64,
        scale = 0.625 * 0.5,
        shift = {6, 6}
      }
    },
See screenshot
expected result is on the left, that's an old icon that I edited together.
actual result is on the right.

Re: strange icons behaviour

Posted: Sun Jun 02, 2019 9:15 am
by Deadlock989
It's been that way for a long time. The first icon in the definition is scaled to fit the container, regardless of what scale you give it. Successive icons are scaled relative to that. If you want to re-use icons to make a composite and they're all smaller than the originals, you have to put a blank icon with scale 1 on the bottom layer.

Re: strange icons behaviour

Posted: Sun Jun 02, 2019 2:26 pm
by bobingabout
Deadlock989 wrote:
Sun Jun 02, 2019 9:15 am
It's been that way for a long time. The first icon in the definition is scaled to fit the container, regardless of what scale you give it. Successive icons are scaled relative to that. If you want to re-use icons to make a composite and they're all smaller than the originals, you have to put a blank icon with scale 1 on the bottom layer.
I figured that's what was going on, but I consider it a bug.
Depends what the devs think though I guess.

Re: strange icons behaviour

Posted: Sun Jun 02, 2019 2:34 pm
by Deadlock989
bobingabout wrote:
Sun Jun 02, 2019 2:26 pm
I figured that's what was going on, but I consider it a bug.
Depends what the devs think though I guess.
I would say more like undocumented behaviour, or a mismatch between user expectation and the actual mechanics, than a bug.

As long as changing it doesn't break everyone else's stuff, I'm fine with it changing. Vanilla never overlays icons on anything other than scale 1 base icons.

Re: strange icons behaviour

Posted: Mon Jun 03, 2019 3:34 pm
by Qon
Deadlock989 wrote:
Sun Jun 02, 2019 2:34 pm
I would say more like undocumented behaviour, or a mismatch between user expectation and the actual mechanics, than a bug.
How is scale not doing anything for the first icon in the list not a bug?
https://wiki.factorio.com/Types/IconData wrote:scale
Type: Types/double
Default: 1
Values different than 1 specify the scale of the icon on default gui scale. Scale 2 means that the icon will be 2 times bigger on screen (and more pixelated).
That's pretty clear what it should do.
Deadlock989 wrote:
Sun Jun 02, 2019 2:34 pm
As long as changing it doesn't break everyone else's stuff, I'm fine with it changing. Vanilla never overlays icons on anything other than scale 1 base icons.
Well if everyone who uses it starts their icon list with a clear icon for the first one to use scale, or doesn't specify scale at all, then it shouldn't break things. Only if you specify a scale != 1 for your first icon (which is really weird to do with the bug unless you never test your mod at all...) will it break things. So I would say fix the bug.

Re: strange icons behaviour

Posted: Mon Jun 03, 2019 3:52 pm
by posila
Thanks for the report.
I consider this duplicate of 69221, please direct the discussion there.