Skip to content

Fix colorize mask for more than 16 colors

This is a solution for bug 412149, in which when you have more than 16 colors in the palette for the colorize mask, then setting one color to transparent will rotate the palette in a seemingly random fashion. A visual description of how the bug looks is found in this post.

The issue was caused because the method KisSwatchGroup::infoList() returns the colors ordered by column first, then by row. But the method KisColorizeMask::setKeyStrokesColors is expecting the colors to come sorted by row first, then by column.

To solve this, I sorted the colors by row first, then by column, as the rest of the code was expecting.

Test Plan

I tested this solution with my own "artwork" and I saw it solved the bug I was finding.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports

Loading