Skip to content

Improve painted feedback while editing shapes.

This is a companion piece to !2018 (merged) , but where the latter tries to improve the speed of the text shape by speeding up drawing, this instead modifies the update compressors surrounding the drawing so that the shapes will update quicker.

This removes the compressor in KoShapeManager, adds one in the reference images canvas, and lowers the compressor delay to 25ms, which is about 24 fps. Together this greatly improves the feel of moving around vectors. When there's a single shape, drawing remains relatively smooth even at a4 size, but once shapes start overlapping, the drawing slows down. Regardless, it doesn't interfere with interaction and the increased feedback feels much better than without.

The second commit also uses the ShapeManagerBlocker to block extra updates when using the shape select and shape edit tools. This is most succesfull when moving the handles of a gradient background on a shape. I had also hoped it would avoid the strange flickering that sometimes happens in the Shape Edit/PathTool when dragging the nodes/segments, but I can still reproduce that (This also happens without this MR).

Test Plan

Make a document with a whole bunch of shapes of all types.

  • Move them around
  • make them huge
  • make them small
  • modify a gradient background.
  • modify some nodes.
  • edit some text.
  • overlap some shapes. (You will notice that shapes overlapping text will slow down dramatically. This is much better with the optimizations in !2018 (merged) implemented)
  • move and edit multiple shapes at once.

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.

Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.

Merge request reports