Bug 436419

Summary: Incremental brush tips do not increment predictably with geometric drawing tools.
Product: [Applications] krita Reporter: wolthera <griffinvalley>
Component: ToolsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ahab.greybeard, TicklishWasabi, voronwe13
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Boerenbont patterned incremental brush.
Image showing correct behaviour on the left and ellipse tool behaviour on the right.
Finges brush tip that only works with the stablizer.
Image showing the problem with the fringe brush, with the upmost being without stablizer and the lowest with stablizer and slow movement.

Description wolthera 2021-04-30 19:06:51 UTC
Created attachment 138035 [details]
Boerenbont patterned incremental brush.

SUMMARY
When using an animated brush tip that increments, these increments work with the freehand brush, but not with the geometric tools. A number of effects are not possible due that.

STEPS TO REPRODUCE
1. Create an animated brush-tip that increments (I will try to attach one that prints a boerenbont pattern)
2. Select the brush-tip and increase the spacing so you can see each individual stamp.
3. Draw a circle with the freehand tool.
4. Draw a circle with the ellipse tool.
5. Compare.

OBSERVED RESULT
In freehand, the stamps increment as expected, resulting in a correct pattern.
In the shape drawing tools, the stamp increments randomly.

EXPECTED RESULT
The shape drawing tools should increment similarly to the freehand tools.

SOFTWARE/OS VERSIONS
Krita

 Version: 5.0.0-prealpha (git fa2b7b6)
 Languages: en_US, en, en_GB, en, nl, en_US, en
 Hidpi: true

Qt

  Version (compiled): 5.15.2
  Version (loaded): 5.15.2

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.4.0-72-generic
  Pretty Productname: KDE neon User Edition 5.21
  Product Type: neon
  Product Version: 20.04
  Desktop: KDE
Comment 1 wolthera 2021-05-01 10:46:38 UTC
Created attachment 138052 [details]
Image showing correct behaviour on the left and ellipse tool behaviour on the right.
Comment 2 wolthera 2021-05-01 10:51:00 UTC
Created attachment 138053 [details]
Finges brush tip that only works with the stablizer.

So, I've noticed a similar issue with an old very delicate incremental brush tip that prints a fringe. When I use it normally without a stablizer, it prints out-of-order. When I use it with stablizer but move my mouse fast, it only occasionally prints out of order. When I use it with stablizer and move the mouse very slowly, it prints correctly.

My guess is that there's some time-sensitive sensor in the brush information that is being used by the incremental brush tips, and because geometric tools are instant, they are unable to increment the brush tip correctly.
Comment 3 wolthera 2021-05-01 10:51:53 UTC
Created attachment 138054 [details]
Image showing the problem with the fringe brush, with the upmost being without stablizer and the lowest with stablizer and slow movement.
Comment 4 Ahab Greybeard 2021-05-02 11:37:17 UTC
I can confirm these observations using the May 02 5.0.0-prealpha (git d2806ec) appimage on Debian 10, with a different incremental .gih brush.

For the attached fringes brush tip, It does seem to work ok if I paint a freehand line very slowly. As speed increases then the stamps become more 'noisy'.
Comment 5 wolthera 2022-07-22 12:13:19 UTC
*** Bug 457014 has been marked as a duplicate of this bug. ***
Comment 6 voronwe13 2024-04-02 20:48:50 UTC
I was about to post a new bug report, but this looks to be the same bug.  A recent discussion on krita-artists.org has narrowed down the source of this bug.  It's an issue with multi-threading in the pixel engine where it's not properly syncing the image selection for the animated brushtip.  See the discussion here: https://krita-artists.org/t/bug-feature-request-poor-precision-on-incremental-animated-brush-tips-causing-skipping-depending-on-speed/86684

Hope this helps!
Comment 7 Dmitry Kazakov 2024-04-24 08:24:26 UTC
Git commit c5b532a6f518146a297465ae9b59bd423f6a1a8e by Dmitry Kazakov.
Committed on 24/04/2024 at 08:24.
Pushed by dkazakov into branch 'master'.

Fix sequence of imagepipe brushes when used in the line tool

We should update parasites **before** actually selecting the brush,
because the freehand brush may have multiple brush resources, which
could have been set up for different sequence numbers

M  +13   -3    libs/brush/kis_brushes_pipe.h
M  +8    -14   libs/brush/kis_imagepipe_brush.cpp
M  +2    -2    libs/brush/kis_text_brush.cpp

https://invent.kde.org/graphics/krita/-/commit/c5b532a6f518146a297465ae9b59bd423f6a1a8e
Comment 8 Dmitry Kazakov 2024-04-24 08:24:42 UTC
Git commit 9171e91d8356a69f0dd1e1e503d46c25121a2aba by Dmitry Kazakov.
Committed on 24/04/2024 at 08:24.
Pushed by dkazakov into branch 'krita/5.2'.

Fix sequence of imagepipe brushes when used in the line tool

We should update parasites **before** actually selecting the brush,
because the freehand brush may have multiple brush resources, which
could have been set up for different sequence numbers


(cherry picked from commit c5b532a6f518146a297465ae9b59bd423f6a1a8e)

M  +13   -3    libs/brush/kis_brushes_pipe.h
M  +8    -14   libs/brush/kis_imagepipe_brush.cpp
M  +2    -2    libs/brush/kis_text_brush.cpp

https://invent.kde.org/graphics/krita/-/commit/9171e91d8356a69f0dd1e1e503d46c25121a2aba