Bug 383909

Summary: Checkbox «Share curve across all settings» doesn’t save the curve if it’s not changed
Product: [Applications] krita Reporter: Owly Owlet <owly.owlet>
Component: Brush enginesAssignee: Tiar <tamtamy.tymona>
Status: RESOLVED FIXED    
Severity: normal CC: freebox64, halla, tamtamy.tymona
Priority: NOR    
Version: 3.2.0   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Curves of the Pressure and PressureIn sensors
Brush A
Brush B

Description Owly Owlet 2017-08-23 12:59:03 UTC
Created attachment 107478 [details]
Curves of the Pressure and PressureIn sensors

1. Choose the brush “Fill_circle”. 
2. Press F5.
3. In the Brush Setting window open ‘Size’
4. Choose any other sensor except “Pressure”

Default settings for “Fill_circle” brush: the “Pressure” curve is not linear, like for other sensors. And checkbox «Share curve across all settings» is active. 
But if you do not change the curve and choose other sensors, their curve stays the same, linear.
But If you change the curve it works just fine.
Comment 1 Halla Rempt 2017-08-23 13:31:46 UTC
Thanks, I'm changing this from Wish to Normal, though, since it does sound like a bug.
Comment 2 mvowada 2018-01-20 18:34:46 UTC
(I can confirm on Ubuntu 14.04 - Krita 4.0.0-beta1.1.appimage)
Comment 3 Tiar 2019-08-14 19:49:40 UTC
Git commit 47a5716210f2f30c3ae4c9ff22e590d1a25b877a by Agata Cacko.
Committed on 14/08/2019 at 19:49.
Pushed by tymond into branch 'master'.

Fix curve change despite 'Use same curve' checked

Before this commit, if you have a preset like Fill_circle
that has "Use the same curve" checkbox checked and you were
clicking on other sensors, the curve would be back to the default
curve (the one that other sensors had) if you switch back and forth
between some sensors (like Pressure -> X-Tilt-> Pressure).

Also before this commit if you have the default uprising curve
and you switched Rotation -> Tilt elevation, the curve would change.

This commit fixes both behaviours (first by adding transferCurve(),
second by switching the line in kis_curve_widget).

This commit also includes two slot functions instead of one function
that were used as a slot for two different signals. It helps with
debugging signals and keeping stuff clear and ordered.

There is one problem left: if you switch Tilt elevation -> Distance
(using the 'hill' curve), the preset is set to modified even though
the curve doesn't change.
BACKPORT:krita/4.2

M  +1    -1    libs/ui/widgets/kis_curve_widget.cpp
M  +18   -2    plugins/paintops/libpaintop/kis_curve_option_widget.cpp
M  +3    -0    plugins/paintops/libpaintop/kis_curve_option_widget.h

https://invent.kde.org/kde/krita/commit/47a5716210f2f30c3ae4c9ff22e590d1a25b877a
Comment 4 Halla Rempt 2019-08-15 07:53:50 UTC
Git commit b915ac470f148a3f4787b1689865a0c4d434ca72 by Boudewijn Rempt, on behalf of Agata Cacko.
Committed on 15/08/2019 at 07:46.
Pushed by rempt into branch 'krita/4.2'.

Fix curve change despite 'Use same curve' checked

Before this commit, if you have a preset like Fill_circle
that has "Use the same curve" checkbox checked and you were
clicking on other sensors, the curve would be back to the default
curve (the one that other sensors had) if you switch back and forth
between some sensors (like Pressure -> X-Tilt-> Pressure).

Also before this commit if you have the default uprising curve
and you switched Rotation -> Tilt elevation, the curve would change.

This commit fixes both behaviours (first by adding transferCurve(),
second by switching the line in kis_curve_widget).

This commit also includes two slot functions instead of one function
that were used as a slot for two different signals. It helps with
debugging signals and keeping stuff clear and ordered.

There is one problem left: if you switch Tilt elevation -> Distance
(using the 'hill' curve), the preset is set to modified even though
the curve doesn't change.
BACKPORT:krita/4.2

M  +1    -1    libs/ui/widgets/kis_curve_widget.cpp
M  +18   -2    plugins/paintops/libpaintop/kis_curve_option_widget.cpp
M  +3    -0    plugins/paintops/libpaintop/kis_curve_option_widget.h

https://invent.kde.org/kde/krita/commit/b915ac470f148a3f4787b1689865a0c4d434ca72
Comment 5 Tiar 2019-08-15 17:21:56 UTC
Created attachment 122144 [details]
Brush A

I believe the fix I provided is only partial. Before when you switched to another preset, it would turned to the default curve. Now it won't switch to another curve, but still if you switch between some specific sensors, then because of the mismatch of ranges in the curve it will change the curve anyway.

I still can see at least two issues:

Brush A: if you go to Rotation and then switch between Fuzzy Dab, then Drawing Angle, then again Fuzzy Dab, the curve will change.

Brush B: if you go to Size and switch between Pressure, Drawing Angle and then Pressure again, it will mark the brush as "modified" even though the curve doesn't change.
Comment 6 Tiar 2019-08-15 17:22:18 UTC
Created attachment 122145 [details]
Brush B
Comment 7 Tiar 2019-09-13 23:24:05 UTC
Git commit 542da22bbbdcdb68e015bdb3b47e3f46c83c6214 by Agata Cacko.
Committed on 13/09/2019 at 23:23.
Pushed by tymond into branch 'master'.

Fix curve changing with sensors w/ Use Same Curve

Before this commit, curve would change semi-randomly in some cases
if you change from some specific sensors to some other specific sensors
(having a complex curve and clicking randomly should show a bug though)
when "Share curve across all settings" is selected.
This commit fixes that behaviour.
Related: bug 410158

M  +3    -3    libs/global/kis_signal_compressor.h
M  +18   -1    libs/ui/widgets/kis_curve_widget.cpp
M  +17   -0    libs/ui/widgets/kis_curve_widget.h
M  +6    -2    libs/ui/widgets/kis_curve_widget_p.h
M  +4    -0    plugins/paintops/libpaintop/kis_auto_brush_widget.cpp
M  +27   -22   plugins/paintops/libpaintop/kis_curve_option.cpp
M  +6    -2    plugins/paintops/libpaintop/kis_curve_option.h
M  +35   -15   plugins/paintops/libpaintop/kis_curve_option_widget.cpp
M  +5    -2    plugins/paintops/libpaintop/kis_curve_option_widget.h

https://invent.kde.org/kde/krita/commit/542da22bbbdcdb68e015bdb3b47e3f46c83c6214
Comment 8 Tiar 2019-09-14 15:26:23 UTC
Git commit a2a86bd9a7c0c595fa6f7e6a7bcfb44144c00e4c by Agata Cacko.
Committed on 14/09/2019 at 15:25.
Pushed by tymond into branch 'krita/4.2'.

Fix curve changing with sensors w/ Use Same Curve

Before this commit, curve would change semi-randomly in some cases
if you change from some specific sensors to some other specific sensors
(having a complex curve and clicking randomly should show a bug though)
when "Share curve across all settings" is selected.
This commit fixes that behaviour.
Related: bug 410158

M  +3    -3    libs/global/kis_signal_compressor.h
M  +18   -1    libs/ui/widgets/kis_curve_widget.cpp
M  +17   -0    libs/ui/widgets/kis_curve_widget.h
M  +6    -2    libs/ui/widgets/kis_curve_widget_p.h
M  +4    -0    plugins/paintops/libpaintop/kis_auto_brush_widget.cpp
M  +27   -22   plugins/paintops/libpaintop/kis_curve_option.cpp
M  +6    -2    plugins/paintops/libpaintop/kis_curve_option.h
M  +35   -15   plugins/paintops/libpaintop/kis_curve_option_widget.cpp
M  +5    -2    plugins/paintops/libpaintop/kis_curve_option_widget.h

https://invent.kde.org/kde/krita/commit/a2a86bd9a7c0c595fa6f7e6a7bcfb44144c00e4c