STextButton: backup color as a local variable
This commit is contained in:
parent
be56de72c1
commit
c6f7e81b70
2 changed files with 2 additions and 3 deletions
|
|
@ -435,13 +435,13 @@ void STextButton::setHoverColor (const CColor& color)
|
|||
|
||||
void STextButton::draw(CDrawContext* context)
|
||||
{
|
||||
backupColor_ = textColor;
|
||||
CColor backupColor = textColor;
|
||||
if (hovered) {
|
||||
textColor = hoverColor_; // textColor is protected
|
||||
}
|
||||
CTextButton::draw(context);
|
||||
if (hovered)
|
||||
textColor = backupColor_;
|
||||
textColor = backupColor;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -160,6 +160,5 @@ public:
|
|||
void draw(CDrawContext* context) override;
|
||||
private:
|
||||
CColor hoverColor_;
|
||||
CColor backupColor_;
|
||||
bool hovered { false };
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue