- fix alpha handling (hopefully)
- remove another leftover debugging line
This commit is contained in:
parent
275a9a5cc0
commit
eefd7dee8c
3 changed files with 2 additions and 8 deletions
|
@ -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"));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue