add operator==()

This commit is contained in:
artemp 2015-07-23 12:58:14 +02:00
parent 6a1a25efbf
commit ce2eaa02ee
2 changed files with 14 additions and 1 deletions

View file

@ -81,7 +81,7 @@ public:
gradient(gradient const& other); gradient(gradient const& other);
gradient(gradient && other); gradient(gradient && other);
gradient& operator=(gradient rhs); gradient& operator=(gradient rhs);
bool operator==(gradient const& other) const;
void set_gradient_type(gradient_e grad); void set_gradient_type(gradient_e grad);
gradient_e get_gradient_type() const; gradient_e get_gradient_type() const;

View file

@ -83,6 +83,19 @@ gradient & gradient::operator=(gradient rhs)
return *this; return *this;
} }
bool gradient::operator==(gradient const& other) const
{
return transform_ == other.transform_ &&
x1_ == other.x1_ &&
y1_ == other.y1_ &&
x2_ == other.x2_ &&
y2_ == other.y2_ &&
r_ == other.r_ &&
std::equal(stops_.begin(),stops_.end(), other.stops_.begin()),
units_ == other.units_ &&
gradient_type_ == other.gradient_type_;
}
void gradient::set_gradient_type(gradient_e grad) void gradient::set_gradient_type(gradient_e grad)
{ {
gradient_type_=grad; gradient_type_=grad;