Prevent chat menu touch to fall throght

This commit is contained in:
iota97 2021-11-19 16:12:26 +01:00
parent b6e7fe1aaf
commit c9deeae6f1

View file

@ -545,11 +545,17 @@ inline float clamp1(float x) {
bool EmuScreen::touch(const TouchInput &touch) {
Core_NotifyActivity();
if (chatMenu_ && (touch.flags & TOUCH_DOWN) != 0 && !chatMenu_->Contains(touch.x, touch.y)) {
chatMenu_->Close();
if (chatButton_)
chatButton_->SetVisibility(UI::V_VISIBLE);
UI::EnableFocusMovement(false);
if (chatMenu_ && chatMenu_->GetVisibility() == UI::V_VISIBLE) {
// Avoid pressing touch button behind the chat
if (chatMenu_->Contains(touch.x, touch.y)) {
chatMenu_->Touch(touch);
return true;
} else if ((touch.flags & TOUCH_DOWN) != 0) {
chatMenu_->Close();
if (chatButton_)
chatButton_->SetVisibility(UI::V_VISIBLE);
UI::EnableFocusMovement(false);
}
}
if (root_) {