Skip to content

Add antialias to the gradients in the cases they showed jagged borders

I've implemented antialiasing for the gradients in the cases they show jagged borders. This happens in the following combinations:

  • Linear gradient with Forwards repeat mode

  • BiLinear gradient with Forwards repeat mode

  • Radial gradient with Forwards repeat mode

  • Square gradient with Forwards repeat mode

  • Spiral gradient with Forwards repeat mode

  • Reverse Spiral gradient with Forwards repeat mode

  • Conical gradient with all repeat modes

  • Spiral gradient with None repeat mode

  • Reverse Spiral gradient with None repeat mode

I have reused the antialias threshold option that was already there but not used. The antialias threshold sets how many pixels the smoothing will extent to each side of the border (e.g. 0 means no antialiasing; 0.5 means an antialias area of 1 pixel wide, 0.5 pixels to each side).

Test Plan

Just open a new image and use the gradient tool to make gradients in the canvas. Change the antialias threshold in the tools docker.

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.

gradient_antialias

Edited by Deif Lou

Merge request reports