434559 - Brush Editor: Fix unchecking share curve resetting curves
Fix for 434559.
The actual fix is very small, but the same thing should happen in both slotModified
and slotUseSameCurveChanged
so I changed them to match.
There was a comment that said !(UseSameCurve) => UseSameCurve
, I don't know what it was supposed to mean. I removed that and the comment beneath it. The code is really self-explanatory without comments.
Now there's two ways to fix this, on unchecking share curve:
- Set all sensors to the current (was shared) curve. This was how it currently is in the MR because that's how I initially thought it should work.
But now I'm thinking the following might make more sense.
- Set only the current sensor to the current (was shared) curve, others reset to how they were before the curve was shared. If the brush has been saved / or krita restarted between checking unchecking, disabled sensors are reset to the default curve.
Test Plan
Should work as follows:
- Turn off share curve.
- Modify the curve of a few sensors.
- Turn share curve on. Curve should not change.
- Switch to other curves: they should all be the curve at step 3.
- Modify the other curves, they should all be modifying the same shared curve.
- Pick a curve, make a modification, uncheck Share Curve. Curve should not change.
- Switch to other curves: how they should be depends on fix picked.
- Modify other curves, they should behave independently now.
Formalities Checklist
-
I confirmed this builds. -
I confirmed Krita ran and the relevant functions work. - [n/a] I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
-
I made sure my commits build individually and have good descriptions as per KDE guidelines. -
I made sure my code conforms to the standards set in the HACKING file. -
I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Edited by Alan North