Skip to content

Reduce the flickering in the line tool preview and lowers the wait time to render a preview.

Reduce the flickering in the line tool preview and lowers the wait time to render a preview.

The flickering would occur when using a tablet with the line preview tool. If you try to hold your stylus steady on the tablet (so you can watch the preview and determine if you want to release there) the preview would flicker every second. This is very annoying visually and makes it harder to look at the result of the preview.

I also tested this on a very weak laptop I have (7 year old intel core-m) and this actually makes the preview more usable on there too. Before the flickering was much more annoying since it takes longer to render each preview. Especially on big brushes the preview would never fully render since it would refresh halfway through completion. This MR allows the preview to finish.

Also lowered the time to wait before the preview would start to render. From 500ms to 200ms when making big movements and 1000ms to 750ms. I think this makes using the preview go from "Its taking a while, is it working?" to "shows up immediately when I stop moving my cursor"

CCBUG:411768

Test Plan

  1. Select the line tool and have "show preview" enabled
  2. draw a stroke and hold the stylus steady (preview should appear more quickly)
  3. Hold stylus steady for a few seconds (preview should not continuously flicker)

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