From a3daf52dd21ae03a8b04e1f9132a6713c9cc414f Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 2 Apr 2024 11:16:30 +0500 Subject: Base scale on 1.0, not on 100.0 Simplifies things by avoiding many repeated multiplications / divisions by 100 during calculations. Change-Id: Ib063d343549139c8d83e5b06570dc61f39ea0df6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165666 Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski --- include/editeng/editdata.hxx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'include/editeng') diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx index 0985e53a1b96..799b29bf5acb 100644 --- a/include/editeng/editdata.hxx +++ b/include/editeng/editdata.hxx @@ -158,21 +158,15 @@ struct ParagraphInfos struct ScalingParameters { - double fFontX = 100.0; - double fFontY = 100.0; - double fSpacingX = 100.0; - double fSpacingY = 100.0; + double fFontX = 1.0; + double fFontY = 1.0; + double fSpacingX = 1.0; + double fSpacingY = 1.0; - bool operator==(const ScalingParameters& rOther) const - { - return fFontX == rOther.fFontX - && fFontY == rOther.fFontY - && fSpacingX == rOther.fSpacingX - && fSpacingY == rOther.fSpacingY; - } + bool operator==(const ScalingParameters& rOther) const = default; bool areValuesDefault() { - return fFontX == 100.0 && fFontY == 100.0 && fSpacingX == 100.0 && fSpacingY == 100.0; + return fFontX == 1.0 && fFontY == 1.0 && fSpacingX == 1.0 && fSpacingY == 1.0; } }; -- cgit