Add non default forecolor flag if forecolor is not white

This commit is contained in:
Jan
2021-12-29 18:08:38 +01:00
parent f628d33a95
commit 8e4b2bb057
4 changed files with 24 additions and 7 deletions

View File

@ -1,5 +1,8 @@
#include "CommonMenuTypes.h"
#include <limits>
#include <cmath>
using namespace menu;
CommonColor::CommonColor()
@ -20,6 +23,14 @@ CommonColor::CommonColor(const double r, const double g, const double b, const d
this->a = a;
}
bool CommonColor::Equals(const CommonColor& other) const
{
return std::fabs(this->r - other.r) < std::numeric_limits<double>::epsilon()
&& std::fabs(this->g - other.g) < std::numeric_limits<double>::epsilon()
&& std::fabs(this->b - other.b) < std::numeric_limits<double>::epsilon()
&& std::fabs(this->a - other.a) < std::numeric_limits<double>::epsilon();
}
CommonRect::CommonRect()
: CommonRect(0, 0, 0, 0)
{

View File

@ -15,6 +15,8 @@ namespace menu
CommonColor();
CommonColor(double r, double g, double b, double a);
bool Equals(const CommonColor& other) const;
};
struct CommonRect