From a77b0b396a9e3c5dc96bf88ab79d43e98b8f3e10 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 25 Apr 2022 02:22:22 +0200 Subject: [PATCH] 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) --- src/gfx/pal_sorting.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gfx/pal_sorting.cpp b/src/gfx/pal_sorting.cpp index abf50fad..08e481d0 100644 --- a/src/gfx/pal_sorting.cpp +++ b/src/gfx/pal_sorting.cpp @@ -76,7 +76,7 @@ void grayscale(std::vector &palettes, assert(palettes.size() == 1); 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) { if (!slot.has_value() || slot->isTransparent()) { continue;