If you apply multiple labels to the same mod, some weird visual artifacts can happen; the affected row can have the text of multiple mods overlapping each other:
Causes
Apparently DataGridView can only handle row colors with an alpha channel of 0 or 255; if you set anything in between, it gets confused and basically seems to not paint the row
If a label has a transparent background color, blending it with a solid color produces an alpha channel of 127, which confuses the grid as per above
Util.BlendColors is implemented in terms of Util.AlphaBlendWith, which uses a floating point alpha channel to compute what it would look like if one color was overlaid over the other with the given level of transparency. Unfortunately, even for two colors with an alpha channel of 255, this can produce a blended color with an alpha channel of 254, which is still enough to confuse the grid.
Changes
Now when we blend label colors, transparent labels are excluded
Now label color blending is done with integer math only, so no rounding errors can creep into the alpha channel
Problem
If you apply multiple labels to the same mod, some weird visual artifacts can happen; the affected row can have the text of multiple mods overlapping each other:
Causes
DataGridView
can only handle row colors with an alpha channel of 0 or 255; if you set anything in between, it gets confused and basically seems to not paint the rowUtil.BlendColors
is implemented in terms ofUtil.AlphaBlendWith
, which uses a floating point alpha channel to compute what it would look like if one color was overlaid over the other with the given level of transparency. Unfortunately, even for two colors with an alpha channel of 255, this can produce a blended color with an alpha channel of 254, which is still enough to confuse the grid.Changes
Fixes #4202.