Skip to content

Replace Smooth Zooming checkbox with Zoom Steps spinbox

Mike Will requested to merge myqwil/krita:smoothzoom-revisit into master

The spinbox represents the number of zoom steps between powers of 2.

This method refrains from using preset zoom levels, and instead uses the base-e functions log() and exp() to switch to and from percentages and their relative indexes.

To retain clean ratios like thirds and quarters, the method has a snapping feature, which snaps a step to a ratio's relative index if they are similar enough.

Edit: The ratio snapping feature has been moved to its own separate commit. There are pros and cons to using this feature, and as time goes on, I am beginning to lean more toward the opinion that we should get rid of it and fully commit to log-based zoom levels. Leaving it in means there will be a few more clean, familiar percentage levels sprinkled in, and taking it out means that the zoom levels will have the smoothest, most natural progression possible. Let me know what you think.

Test Plan

  1. Go to Settings -> Configure Krita... -> General -> Tools
  2. Where the Smooth Zooming checkbox used to be, there will be a spin box. Change the value to a number between 1 and 32.
  3. If, for example, the number is set to 5, there will now be 5 steps between 50% and 100%, or 100% and 200%, etc.

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. (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 Mike Will

Merge request reports

Loading