From c6f7e81b70bd4cb307db3f4211d3a955e78d8a05 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Fri, 11 Sep 2020 14:05:26 +0200 Subject: [PATCH] STextButton: backup color as a local variable --- editor/src/editor/GUIComponents.cpp | 4 ++-- editor/src/editor/GUIComponents.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) 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 }; };