Fix grayscale sorting not setting palette size

A black+white palette would turn into white+transparent, removing black pixels
from the palette (the third slot would be empty, and the 4th slot be set directly)
This commit is contained in:
ISSOtm
2022-04-25 02:22:22 +02:00
committed by Eldred Habert
parent 568fb5e4c8
commit a77b0b396a

View File

@@ -76,7 +76,7 @@ void grayscale(std::vector<Palette> &palettes,
assert(palettes.size() == 1); assert(palettes.size() == 1);
Palette &palette = palettes[0]; Palette &palette = palettes[0];
std::fill(palette.begin(), palette.end(), Rgba::transparent); std::fill(palette.colors.begin(), palette.colors.end(), Rgba::transparent);
for (auto const &slot : colors) { for (auto const &slot : colors) {
if (!slot.has_value() || slot->isTransparent()) { if (!slot.has_value() || slot->isTransparent()) {
continue; continue;