Diffusion Krita 9d5baac8ad84

Refactor KoUnit

Authored by tymond on Mar 5 2019, 10:27 AM.

Description

Refactor KoUnit

Summary:
This commit fixes two problems in KoUnit:
(1) two functions named differently while doing
nearly exactly the same thing (ptToUnit, toUserValue)
and the difference in the name or arguments of functions
not showing the difference in the results,
(2) repeated constant values in functions
called to[Unit] (i.e. toMillimeters).
This commit is not to cause any difference in behaviour
(including in particular converting and rounding values)
and contains unit tests to test that.

Test Plan:

  • created unit test to test the difference in conversions

(should not none).

  • all the places where the difference in functions naming

caused changes in files other than [Test]KoUnit.h/.cpp

Reviewers: Krita, rempt

Reviewed By: Krita, rempt

Subscribers: rempt

Tags: Krita

Differential Revision: https://phabricator.kde.org/D19537

Details

Committed
tymondMar 5 2019, 6:03 PM
Reviewer
Krita
Differential Revision
D19537: Refactor KoUnit
Parents
R37:e3c5a596428b: Add validation for node properties set through UI
Branches
Unknown
Tags
Unknown