Skip to content

Share curve across all settings: reworked, fixed bugs

What I did

  1. Added common curve variable that keeps the value of the common curve
  2. If the brush is from before my commit, the common value will take the value of the last sensor used... that's not a problem though because (a) if the brush had "Share curve..." already selected, all sensors has the same curve (b) if it was not selected and the user selected it, it will take the value of the last highlighted curve
  3. !Share -> Share -> !Share => will restore the curves (changed by user, if applicable).
  4. Share + changed curve -> !Share => it won't set the changed curve to the sensor
  5. Fixes bug: https://bugs.kde.org/show_bug.cgi?id=383909
  6. Fixes this bug too, I think: https://bugs.kde.org/show_bug.cgi?id=410158

Left to do

  • squash commits to first two
  • make sure both bug numbers are inside one of the commit messages, hopefully the relevant one

Test Plan

Tests:

  1. Share curve across all settings behaviour:
  • the same curve is presented in all sensors
  • it doesn't change if you click on all the sensors how much you want
  • if you change it (both spinboxes and mouse), close BE and open again, it will stay the same (changed) curve
  • changing it marks the brush as dirty
  • changing it using spinboxes marks the brush as dirty
  • not changing should not mark it dirty
  1. !(Share curve...)
  • curves are unique for sensors
  • when the sensor is disabled, the curve is default (0 - 1) (?) - at least it doesn't inherit from the previous sensor or anything like that
  • if you change a curve and switch the sensor, then come back, it will remain the same changed curve as before
  • if you change a curve, it marks the preset as dirty
  • if you change a curve using spinboxes, it marks the preset as dirty
  • if you change a curve and close BE and reopen, the curve should stay changed
  • not changing should not mark it dirty
  1. Switching from Share to !Share
  • just get the curves from the preset? or the common curve? maybe if dirty, get from preset, if not dirty, get from the common curve?
  • current behaviour: active/saved sensors takes the common curve, non-active takes the default curve
  • current behaviour when without save: all like before
  • all behaviour from !Share should be working correctly
  • after reset of the brush preset, the common curve should be restored correctly (see Dmitry's comment below)
  1. Switching from !Share to Share
  • the current curve is taken as the common curve (that is the current behaviour and it's rather sane)
  • all behaviour from Share should be working correctly
  • should mark the brush as dirty
  • if I use !Share -> Share -> !Share, it should restore a previous curve for the sensor I'm on right now (default/set/changed)
  1. Saving brushes
  • behaviour and everything in BE should be the same as before saving?
  • except for the restored curves if Share is used - old behaviour was to drop them, too
  1. Dirty presets
  • just the same as save, but without saving
  1. Other affected code
  • cross channel filter
  • color adjustment curves filter

Bugs:

  • [fixed] point change using spinboxes doesn't mark the brush modified...
  • [fixed] !(Share) still can make the curve modified if it's not
  • [fixed] Switching from !Share to Share doesn't mark brush dirty
  • [fixed] Switching Share -> !Share -> reset the brush preset should restore the common curve
  • changed common curve with Share -> !Share => it doesn't keep the curve... but should it?

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (Are there any relevant unit tests that I should run?)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines. (will rebase later)
  • 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 Agata Cacko

Merge request reports