Bug 375360

Summary: Speed curve doesn't seem to work when inverted
Product: [Applications] krita Reporter: Piotr Adamowicz <padamowicz>
Component: Brush enginesAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: griffinvalley
Priority: NOR    
Version: 3.1.1   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description Piotr Adamowicz 2017-01-21 07:59:29 UTC
Reproduction:
1. Set a pixel brush's size to be affected by speed
2. Make a stroke. Note that faster strokes produce thicker lines. This is as expected, though not very useful.
3. Now invert the curve so that faster strokes produce thinner lines.
4. Make a stroke. Note that the speed of the stroke doesn't seem to be affecting the size at all.

https://bugs.kde.org/show_bug.cgi?id=325423 seems to be a similar bug, but it's marked as resolved back in 2015, so I'm assuming this is something new.

Windows 10, Wacom Intuos3, Krita 3.1.1
Comment 1 wolthera 2017-10-24 14:16:48 UTC
It does work here, but what I am seeing is that speed has a massive fall-off... My speed curves look more like an inverted J curve than straight. It might need some kind of normalisation.
Comment 2 Dmitry Kazakov 2020-09-17 22:47:12 UTC
Git commit 4b7cab76c1cd24bfc98b257648530f221dd94807 by Dmitry Kazakov.
Committed on 17/09/2020 at 22:15.
Pushed by dkazakov into branch 'master'.

Fix speed smoothing algorithm not to generate blobs during the stroke

There were the following problems:

1) KisPaintingInformationBuilder::hover() geneated distance noise
   while the user was painting on screen. Now it doesn't add sample
   points when the stroke is started, only while hovering.

2) KisSpeedSmoother now has longer buffer. 10 samples was too low value
   for tablets emitting events every 7 ms. 512 should be enough for
   everyone!

3) Now there is a minimal smoothing time range. It is set to 15 ms.
Related: bug 363364

M  +5    -2    libs/ui/tool/kis_painting_information_builder.cpp
M  +2    -1    libs/ui/tool/kis_painting_information_builder.h
M  +29   -10   libs/ui/tool/kis_speed_smoother.cpp
M  +2    -0    libs/ui/tool/kis_speed_smoother.h
M  +1    -1    libs/ui/tool/kis_tool_freehand_helper.cpp
M  +1    -1    plugins/tools/tool_transform2/kis_liquify_paint_helper.cpp

https://invent.kde.org/graphics/krita/commit/4b7cab76c1cd24bfc98b257648530f221dd94807
Comment 3 Dmitry Kazakov 2020-09-22 09:14:52 UTC
Git commit 4211646e20c928c0013402cce938f2f0555b3fe7 by Dmitry Kazakov.
Committed on 22/09/2020 at 09:14.
Pushed by dkazakov into branch 'krita/4.3'.

Fix speed smoothing algorithm not to generate blobs during the stroke

There were the following problems:

1) KisPaintingInformationBuilder::hover() geneated distance noise
   while the user was painting on screen. Now it doesn't add sample
   points when the stroke is started, only while hovering.

2) KisSpeedSmoother now has longer buffer. 10 samples was too low value
   for tablets emitting events every 7 ms. 512 should be enough for
   everyone!

3) Now there is a minimal smoothing time range. It is set to 15 ms.
Related: bug 363364

M  +5    -2    libs/ui/tool/kis_painting_information_builder.cpp
M  +2    -1    libs/ui/tool/kis_painting_information_builder.h
M  +29   -10   libs/ui/tool/kis_speed_smoother.cpp
M  +2    -0    libs/ui/tool/kis_speed_smoother.h
M  +1    -1    libs/ui/tool/kis_tool_freehand_helper.cpp
M  +1    -1    plugins/tools/tool_transform2/kis_liquify_paint_helper.cpp

https://invent.kde.org/graphics/krita/commit/4211646e20c928c0013402cce938f2f0555b3fe7