diff --git a/editor/src/editor/GUIComponents.cpp b/editor/src/editor/GUIComponents.cpp index 0ebcc7d9..be9899ef 100644 --- a/editor/src/editor/GUIComponents.cpp +++ b/editor/src/editor/GUIComponents.cpp @@ -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; } diff --git a/editor/src/editor/GUIComponents.h b/editor/src/editor/GUIComponents.h index 83d7d04a..e0f3b173 100644 --- a/editor/src/editor/GUIComponents.h +++ b/editor/src/editor/GUIComponents.h @@ -160,6 +160,5 @@ public: void draw(CDrawContext* context) override; private: CColor hoverColor_; - CColor backupColor_; bool hovered { false }; };