Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Use qFuzzyCompare for KoCSSFontInfo.h

Wolthera van Hövell tot Westerflierd2e481410039
diff --git a/libs/flake/text/KoCSSFontInfo.h b/libs/flake/text/KoCSSFontInfo.h
index d4c29041d2..483a928d14 100644
--- a/libs/flake/text/KoCSSFontInfo.h
+++ b/libs/flake/text/KoCSSFontInfo.h
@@ -56,13 +56,13 @@ struct KRITAFLAKE_EXPORT KoCSSFontInfo: public boost::equality_comparable<KoCSSF
}
bool operator==(const KoCSSFontInfo &rhs) const {
- bool sizeMatch = automaticOpticalSizing? true: size == rhs.size;
- bool slantMatch = autoSlant == rhs.autoSlant? true: slantValue == rhs.slantValue;
+ bool sizeMatch = automaticOpticalSizing? true: qFuzzyCompare(size, rhs.size);
+ bool slantMatch = autoSlant == rhs.autoSlant? true: qFuzzyCompare(slantValue, rhs.slantValue);
return families == rhs.families
&& automaticOpticalSizing == rhs.automaticOpticalSizing
&& sizeMatch
- && weight == rhs.weight
- && width == rhs.width
+ && qFuzzyCompare(weight, rhs.weight)
+ && qFuzzyCompare(width, rhs.width)
&& slantMode == rhs.slantMode
&& slantMatch
&& axisSettings == rhs.axisSettings;