Skip to content

KoZoomAction: replace log(2) with math constant M_LN2

Mike Will requested to merge myqwil/krita:ln2-constant into master

This is a relatively small change. I noticed that math.h has a constant specifically for log(2).

Test Plan

This change affects the zoom-steps feature, which was introduced in !1581 (merged). The same test plan described there also applies here.

There won't be any noticeable difference to how this feature works, but it will be slightly faster, since the log(2) calculation won't be performed every time that zoom levels are generated.

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.

Merge request reports