Bug 234308 - Speed curve's speed always seems to register zero at start of a brush stroke
Summary: Speed curve's speed always seems to register zero at start of a brush stroke
Alias: None
Product: krita
Classification: Unclassified
Component: Brush engines (show other bugs)
Version: unspecified
Platform: Ubuntu Packages Linux
: NOR normal
Target Milestone: ---
Assignee: LukasT
Depends on:
Reported: 2010-04-14 05:02 UTC by Kubuntiac
Modified: 2013-08-03 20:45 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:

i try to use a curve, that is less steep (40.66 KB, image/png)
2010-06-19 10:43 UTC, Adam C
however, i believe, that this could be also a feature. (41.39 KB, image/png)
2010-06-19 10:45 UTC, Adam C

Note You need to log in before you can comment on or make changes to this bug.
Description Kubuntiac 2010-04-14 05:02:12 UTC
Version:           1114466 (using KDE 4.4.2)
OS:                Linux
Installed from:    Ubuntu Packages

When using speed curve to change the size of a brush, I expect the brush size to match the cursor speed from the very beginning of the brush stroke.

At the start of the brush stroke, the stroke is always huge. It then shrinks quickly to the expected brush size. It starts at the same size whether the cursor was moving rapidly or very slowly when the brush stroke begins.


In this example, the cursor was moving at a fairly consistent speed before, during and after the brush stroke.

1. Select a painttop (I used the default pixel brush)
2. Turn on the speed curve in the brush size configuration.
3. Paint a brush stroke with a smooth even movement.
4. Notice that every stroke begins oversize and then shrinks rapidly.
Comment 1 Sven Langkamp 2010-06-19 02:18:57 UTC
I don't think this is an actual bug. This setting is very sensitive, so even a rather small speed increase does a big change. Try to use a curve that is less steep to reduce the effect.
Comment 2 Adam C 2010-06-19 10:43:41 UTC
Created attachment 48132 [details]
i try to use a curve, that is less steep

i try to use a curve, that is less steep and get the same result.
the brushsize of the starting brush depends on the curve's maximum.
Comment 3 Adam C 2010-06-19 10:45:00 UTC
Created attachment 48133 [details]
however, i believe, that this could be also a feature.
Comment 4 Sven Langkamp 2010-06-20 19:41:27 UTC
I took a look at the code and the problem is the way the speed is calculated:
Because the moved distance is zero at the start of the stroke, distance/time will be zero too (time is always big than zero) that causes the maximum value.

Problem is that we don't know the speed in the first moment. Not sure how to solve that.
Comment 5 Cyrille Berger 2010-06-21 17:50:03 UTC
As Adam suggested it on IRC, the speed of the pointer could be tracked even when not drawing. To make it work, the speed of the cursor should be computed in the freehand tool, and added to KisPaintInformation, and then the speed sensor can read it from there instead of computing it from the time and distance.
Comment 6 LukasT 2010-09-22 10:37:03 UTC
This one will be solved probably by using dyna's way of computing speed. For 2.4 as discussed with Cyrille and Boud.
Comment 7 LukasT 2010-09-22 10:38:58 UTC
They disagree with LATER :)
Comment 8 Dmitry Kazakov 2013-08-03 20:45:13 UTC
Git commit 6fcba2eb1bfd29bb54af8e10a145eb1def17c8d8 by Dmitry Kazakov.
Committed on 03/08/2013 at 19:25.
Pushed by dkazakov into branch 'master'.

Initialize averaging buffer with initial speed value

M  +8    -2    krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensors.cc
M  +1    -5    krita/plugins/paintops/libpaintop/sensors/kis_dynamic_sensors.h