UI: Fix fade-out when editing touch controls.

This commit is contained in:
Unknown W. Brackets 2017-06-03 08:41:56 -07:00
parent 979bc58cac
commit cb1b8f23bb
2 changed files with 8 additions and 1 deletions

View File

@ -34,7 +34,7 @@ public:
void Update() override; void Update() override;
protected: protected:
float GetButtonOpacity(); virtual float GetButtonOpacity();
float lastFrameTime_; float lastFrameTime_;
float secondsWithoutTouch_; float secondsWithoutTouch_;

View File

@ -15,6 +15,7 @@
// Official git repository and contact information can be found at // Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include <algorithm>
#include <vector> #include <vector>
#include "base/colorutil.h" #include "base/colorutil.h"
@ -65,6 +66,12 @@ public:
virtual float GetSpacing() const { return 1.0f; } virtual float GetSpacing() const { return 1.0f; }
virtual void SetSpacing(float s) { } virtual void SetSpacing(float s) { }
protected:
float GetButtonOpacity() override {
float opacity = g_Config.iTouchButtonOpacity / 100.0f;
return std::max(0.5f, opacity);
}
private: private:
// convert from screen coordinates (leftColumnWidth to dp_xres) to actual fullscreen coordinates (0 to 1.0) // convert from screen coordinates (leftColumnWidth to dp_xres) to actual fullscreen coordinates (0 to 1.0)
inline float toFullscreenCoord(int screenx) { inline float toFullscreenCoord(int screenx) {