From 8e8063a06609d5f0dee69a1adfed7acd2e248c97 Mon Sep 17 00:00:00 2001 From: uye <99072975+ABA2396@users.noreply.github.com> Date: Sat, 27 Sep 2025 00:32:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=80=8E=E4=B9=88=E8=BF=98=E6=9C=89?= =?UTF-8?q?=E4=BA=BA=E5=9C=A8=E7=94=A8=20adb=20input?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Controller/ControlScaleProxy.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/MaaCore/Controller/ControlScaleProxy.cpp b/src/MaaCore/Controller/ControlScaleProxy.cpp index dc247075d3..00329922e5 100644 --- a/src/MaaCore/Controller/ControlScaleProxy.cpp +++ b/src/MaaCore/Controller/ControlScaleProxy.cpp @@ -114,10 +114,22 @@ bool asst::ControlScaleProxy::swipe( bool with_pause, bool high_resolution_swipe_fix) { - auto rand_p1 = rand_point_in_rect(r1); - auto rand_p2 = rand_point_in_rect(r2); + Point rand_p1, rand_p2; + bool precise1 = (r1.width == 1 && r1.height == 1); + bool precise2 = (r2.width == 1 && r2.height == 1); - if (m_controller_type == ControllerType::Adb) { + if (precise1) + rand_p1 = Point(r1.x, r1.y); + else + rand_p1 = rand_point_in_rect(r1); + + if (precise2) + rand_p2 = Point(r2.x, r2.y); + else + rand_p2 = rand_point_in_rect(r2); + + if (m_controller_type == ControllerType::Adb && !(precise1 && precise2)) { + // 只有不是精确点时才做ADB修正 // 同样的参数 ADB 总是划过头,糊点屎进来 // 外部调用 swipe(Point, Point) 时,说明是精确要求位置的,不能做这个调整 // 所以屎没法糊在下面一层,只能糊在这里了(