From 4bab20d67c0e662ee06e383d1da164e2cff068d1 Mon Sep 17 00:00:00 2001 From: twanvl Date: Fri, 11 Jul 2008 18:01:36 +0000 Subject: [PATCH] Fixed: Incorrect comparison operator for AColor caused Scriptables to not be updated when only the alpha changed. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1024 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/gfx/color.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gfx/color.hpp b/src/gfx/color.hpp index 6b1d39b8..c449735d 100644 --- a/src/gfx/color.hpp +++ b/src/gfx/color.hpp @@ -25,6 +25,11 @@ class AColor : public Color { inline AColor() : alpha(0) {} inline AColor(Byte r, Byte g, Byte b, Byte a = 255) : Color(r,g,b), alpha(a) {} inline AColor(const Color& color, Byte a = 255) : Color(color), alpha(a) {} + + inline bool operator == (const AColor& that) const { + return static_cast(*this) == static_cast(that) && alpha == that.alpha; + } + inline bool operator != (const AColor& that) const { return ! (*this == that); } }; // ----------------------------------------------------------------------------- : Parsing