Bug 426234

Summary: PressureIn sensor often bugs out when used with Color options
Product: [Applications] krita Reporter: tomtomtomreportingin
Component: Brush enginesAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: dimula73
Priority: NOR    
Version: 4.3.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: PressureIn when used in combination with Hue. Notice alternating hues midstroke.

Description tomtomtomreportingin 2020-09-06 04:11:06 UTC
Created attachment 131442 [details]
PressureIn when used in combination with Hue. Notice alternating hues midstroke.

SUMMARY
When using the PressureIn sensor with brush options under the Color category, the max pressure is often bugged midstroke and will alternate with a previous max pressure.

STEPS TO REPRODUCE
1. Select Basic-2 Opacity
2. Disable Opacity
3. Enable one of the following brush options: Darken, Mix, Hue, Saturation, or Value (not sure if it happens with Rate)
4. Disable Pressure and enable PressureIn for the color option you selected
5. Make multiple long strokes as the bugged result might not always happen

OBSERVED RESULT
The max inputted pressure might revert and continuously alternate to a previous, lower pressure in the middle of a stroke. See attachment.

EXPECTED RESULT
The highest pressure inputted should stay consistent and should not move lower midstroke.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian sid
(available in About System)
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.70.0
Qt Version: 5.12.8 (Appimage)

ADDITIONAL INFORMATION
TABLET: Wacom Intuos Medium
I have not noticed this happening with other options.
Comment 1 tomtomtomreportingin 2020-09-06 07:14:26 UTC
Hm, it might happen more consistently if the brush preset is set at a very large size.
Comment 2 Dmitry Kazakov 2020-09-17 22:47:04 UTC
Git commit fb017c98988028cc985017a24a43fddeac602b71 by Dmitry Kazakov.
Committed on 17/09/2020 at 22:15.
Pushed by dkazakov into branch 'master'.

Fix PressureIn sensor

PixelBrush is multithreaded, therefore sensors should not store
any internal state. We have KisDistanceInformation exactly for
this purpose.

M  +14   -0    libs/image/brushengine/kis_paint_information.cc
M  +8    -0    libs/image/brushengine/kis_paint_information.h
M  +9    -0    libs/image/kis_distance_information.cpp
M  +2    -0    libs/image/kis_distance_information.h
M  +2    -13   plugins/paintops/libpaintop/sensors/kis_dynamic_sensors.cc
M  +1    -16   plugins/paintops/libpaintop/sensors/kis_dynamic_sensors.h

https://invent.kde.org/graphics/krita/commit/fb017c98988028cc985017a24a43fddeac602b71
Comment 3 Dmitry Kazakov 2020-09-22 09:14:44 UTC
Git commit b63f52805828da6f2db6928037d3e9f9c77d9fe1 by Dmitry Kazakov.
Committed on 22/09/2020 at 09:14.
Pushed by dkazakov into branch 'krita/4.3'.

Fix PressureIn sensor

PixelBrush is multithreaded, therefore sensors should not store
any internal state. We have KisDistanceInformation exactly for
this purpose.

M  +14   -0    libs/image/brushengine/kis_paint_information.cc
M  +8    -0    libs/image/brushengine/kis_paint_information.h
M  +9    -0    libs/image/kis_distance_information.cpp
M  +2    -0    libs/image/kis_distance_information.h
M  +2    -13   plugins/paintops/libpaintop/sensors/kis_dynamic_sensors.cc
M  +1    -16   plugins/paintops/libpaintop/sensors/kis_dynamic_sensors.h

https://invent.kde.org/graphics/krita/commit/b63f52805828da6f2db6928037d3e9f9c77d9fe1