diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 3644ff5f54..18d3207327 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -1905,7 +1905,7 @@ void GestureMappingScreen::CreateGestureTab(UI::LinearLayout *vert, int zoneInde vert->Add(new PopupSliderChoiceFloat(&zone.fSwipeSmoothing, 0.0f, 0.95f, 0.3f, co->T("Swipe smoothing"), 0.05f, screenManager(), "x"))->SetEnabledPtr(&zone.bGestureControlEnabled); vert->Add(new ItemHeader(co->T("Double tap"))); - vert->Add(new PopupMultiChoice(&zone.iDoubleTapGesture, mc->T("Double tap button"), gestureButton, 0, ARRAY_SIZE(gestureButton), I18NCat::MAPPABLECONTROLS, screenManager()))->SetEnabledPtr(&zone.bGestureControlEnabled); + vert->Add(new PopupMultiChoice(&zone.iDoubleTapGesture, mc->T("Double tap button"), gestureButton, 0, ARRAY_SIZE(gestureButton), I18NCat::MAPPABLECONTROLS, screenManager())); vert->Add(new ItemHeader(co->T("Analog Stick"))); vert->Add(new CheckBox(&zone.bAnalogGesture, co->T("Enable analog stick gesture"))); diff --git a/UI/GamepadEmu.cpp b/UI/GamepadEmu.cpp index 6189e4c82f..6bcf4442ac 100644 --- a/UI/GamepadEmu.cpp +++ b/UI/GamepadEmu.cpp @@ -1098,7 +1098,7 @@ GamepadEmuView::GamepadEmuView(const TouchControlConfig &config, float xres, flo // Add the two gesture zones. for (int i = 0; i < 2; i++) { - if (g_Config.gestureControls[i].bGestureControlEnabled) { + if (g_Config.gestureControls[i].bGestureControlEnabled || g_Config.gestureControls[i].bAnalogGesture) { // We have them both cover the whole surface, then limit in the touch handler. // This is because there's no easy way to do "half the screen" in AnchorLayout. // We can do more complex layout combinations, but meh. @@ -1236,6 +1236,14 @@ void GestureGamepad::Update() { const float th = 1.0f; float dx = deltaX_ * g_display.dpi_scale_x * GetZone().fSwipeSensitivity; float dy = deltaY_ * g_display.dpi_scale_y * GetZone().fSwipeSensitivity; + const float smoothing = GetZone().fSwipeSmoothing; + deltaX_ *= smoothing; + deltaY_ *= smoothing; + + if (!GetZone().bGestureControlEnabled) { + return; + } + if (GetZone().iSwipeRight != 0) { if (dx > th) { controlMapper_->PSPKey(DEVICE_ID_TOUCH, GestureKey::keyList[GetZone().iSwipeRight - 1], KeyInputFlags::DOWN); @@ -1272,7 +1280,4 @@ void GestureGamepad::Update() { swipeDownReleased_ = true; } } - const float smoothing = GetZone().fSwipeSmoothing; - deltaX_ *= smoothing; - deltaY_ *= smoothing; }