diff --git a/include/mapnik/gradient.hpp b/include/mapnik/gradient.hpp index c7fafd81d..f8eff6e7d 100644 --- a/include/mapnik/gradient.hpp +++ b/include/mapnik/gradient.hpp @@ -81,7 +81,7 @@ public: gradient(gradient const& other); gradient(gradient && other); gradient& operator=(gradient rhs); - + bool operator==(gradient const& other) const; void set_gradient_type(gradient_e grad); gradient_e get_gradient_type() const; diff --git a/src/gradient.cpp b/src/gradient.cpp index a10838597..037cf8fc7 100644 --- a/src/gradient.cpp +++ b/src/gradient.cpp @@ -83,6 +83,19 @@ gradient & gradient::operator=(gradient rhs) 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) { gradient_type_=grad;