From: mfranz Date: Wed, 13 Jul 2005 06:37:39 +0000 (+0000) Subject: - fix alpha handling (hopefully) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=eefd7dee8c31d515676afaacd1ab1144d3e77d1f;p=flightgear.git - fix alpha handling (hopefully) - remove another leftover debugging line --- diff --git a/src/GUI/dialog.cxx b/src/GUI/dialog.cxx index 8d8f14185..3b2484150 100644 --- a/src/GUI/dialog.cxx +++ b/src/GUI/dialog.cxx @@ -667,7 +667,6 @@ void FGDialog::setColor(puObject * object, SGPropertyNode * props, int which) { string type = props->getName(); - string watch = "button"; FGColor c(_gui->getColor("background")); c.merge(_gui->getColor(type)); c.merge(props->getNode("color")); diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index 5a9f6ee0a..e9f19e29e 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -372,8 +372,6 @@ FGColor::merge(const SGPropertyNode *node) _blue = n->getFloatValue(), dirty = true; if ((n = node->getNode("alpha"))) _alpha = n->getFloatValue(), dirty = true; - else - _alpha = 1.0; return dirty; } @@ -389,8 +387,6 @@ FGColor::merge(const FGColor& color) _blue = color._blue, dirty = true; if (color._alpha >= 0.0) _alpha = color._alpha, dirty = true; - else - _alpha = 1.0; return dirty; } diff --git a/src/GUI/new_gui.hxx b/src/GUI/new_gui.hxx index e0c46837f..081970f70 100644 --- a/src/GUI/new_gui.hxx +++ b/src/GUI/new_gui.hxx @@ -220,8 +220,7 @@ public: return true; } bool isValid() const { - return _red >= 0.0 && _green >= 0.0 && _blue >= 0.0 - && _alpha >= 0.0; + return _red >= 0.0 && _green >= 0.0 && _blue >= 0.0; } void print() const { std::cerr << "red=" << _red << ", green=" << _green @@ -236,7 +235,7 @@ public: inline float red() const { return clamp(_red); } inline float green() const { return clamp(_green); } inline float blue() const { return clamp(_blue); } - inline float alpha() const { return clamp(_alpha); } + inline float alpha() const { return _alpha < 0.0 ? 1.0 : clamp(_alpha); } protected: float _red, _green, _blue, _alpha;