Bug 423778 - Limited value range when painting with tangential pressure
Summary: Limited value range when painting with tangential pressure
Status: REPORTED
Alias: None
Product: krita
Classification: Applications
Component: Tablets (tablet issues are only very rarely bugs in Krita!) (show other bugs)
Version: 4.3.0
Platform: Microsoft Windows Other
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2020-07-02 02:56 UTC by ollewellyn
Modified: 2020-08-01 17:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ollewellyn 2020-07-02 02:56:10 UTC
SUMMARY
The value range for tangential pressure is halved regardless of curve settings when painting with a Wacom Airbrush pen.

STEPS TO REPRODUCE
Enable tangential pressure for any brush option (hue, value, etc) and paint using the pen wheel.

OBSERVED RESULT
The value range goes from 0 to 0.5

EXPECTED RESULT
The value range should go from 0 to 1


SOFTWARE/OS VERSIONS
Windows: Windows 10 Pro version 1903
Comment 1 Tiar 2020-08-01 17:28:27 UTC
Ok, so it looks like there is a little bug that mouse gets the value "0.0" instead of "0.5" like my tablet pen that doesn't support this type of pressure.

However from the code, I cannot see how this bug is there.
Qt's documentation: https://doc.qt.io/archives/qt-4.8/qtabletevent.html#tangentialPressure , so it returns a value in range (-1, 1)
Then Krita in https://invent.kde.org/graphics/krita/-/blob/master/libs/flake/KoPointerEvent.cpp#L179 (KoPointerEvent::tangentialPressure()) returns a value:
fmod( (x+1)/2 , 2), which is in range (0,1), with -1 => 0, 1 => 1. (0, being the neutral one, is converted to 0.5).

However Qt's documentation says: "Current airbrushes can only move in the positive direction from the neutrual position."
That could explain half of the range... but if it was the half (0.5,1.0), not (0,0.5).