Skip to content

Fix Dynamic Brush Tool using brush smoothing from regular Brush Tool

Mathias Wein requested to merge mwein/krita:bug493249_dynamic_brush into master

This is a fix for BUG:493249.

From what I can tell, the issue is limited to the tool initialization when a document is created/loaded. While the bug report says something about the Freehand Brush Tool getting affected in some way too, I can't find any code in the Dynamic Brush Tool that could affect the Freehand Brush Tool, I assume reporter was just confused by what's going on without knowing the exact trigger.

But maybe ´KisSmoothingOptions´ should also disable writing its values to the config on parameter changes when it was constructed with useSavedSmoothing = false, just to be sure.

Note that this makes the Dynamic Brush Tool use the "Basic" smoothing algorithm, rather than no smooting at all, but since it only manipulates the input events and does no interpolations on its own, this seems apropriate to prevent segmented lines on fast strokes.

Test Plan

The relevant instructions from the bug report to reproduce the issue:

  • Enable Stabilizer in Freehand Brush Tool.
  • Close document.
  • Open a document (new or existing doesn't matter).
  • Select Dynamic Brush Tool and paint.

Unfixed it should show the extra circle of the stabilizer and also behave accordingly, with this fix, the tool should behave as expected.

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.
  • Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?

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

Loading