diff --git a/resource/tasks.json b/resource/tasks.json index 37b2cb013e..3850a8cee7 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -17,7 +17,7 @@ ], "rectMove_Doc": "滑动终点", "specialParams": [ - 1000, + 200, 1 ], "specialParams_Doc": [ @@ -45,7 +45,7 @@ 100 ], "specialParams": [ - 1000, + 200, 1 ], "next": [ @@ -4403,9 +4403,6 @@ 310, 100, 100 - ], - "specialParams": [ - 300 ] }, "SleepAfterOperListSwipe": { diff --git a/src/MeoAssistant/Controller.cpp b/src/MeoAssistant/Controller.cpp index 94b907e5bf..aca69abe34 100644 --- a/src/MeoAssistant/Controller.cpp +++ b/src/MeoAssistant/Controller.cpp @@ -1121,13 +1121,13 @@ bool asst::Controller::swipe_without_scale(const Point& p1, const Point& p2, int _x2 = static_cast(_x2 * m_minitouch_props.x_scaling); _y2 = static_cast(_y2 * m_minitouch_props.y_scaling); - int move_times = _duration / MoveInterval; - int x_step = (_x2 - _x1) / move_times; - int y_step = (_y2 - _y1) / move_times; + double move_times = static_cast(_duration) / MoveInterval; + double x_step = (_x2 - _x1) / move_times; + double y_step = (_y2 - _y1) / move_times; // TODO: 加点随机因子,或者改成中间快两头慢 for (int times = 1; times < move_times; ++times) { - int cur_x = _x1 + x_step * times; - int cur_y = _y1 + y_step * times; + int cur_x = _x1 + static_cast(x_step * times); + int cur_y = _y1 + static_cast(y_step * times); if (cur_x < 0 || cur_x > m_minitouch_props.max_x || cur_y < 0 || cur_y > m_minitouch_props.max_y) { continue; } diff --git a/src/MeoAssistant/Task/Sub/AbstractTask.cpp b/src/MeoAssistant/Task/Sub/AbstractTask.cpp index d8be4271c3..cce0806241 100644 --- a/src/MeoAssistant/Task/Sub/AbstractTask.cpp +++ b/src/MeoAssistant/Task/Sub/AbstractTask.cpp @@ -217,10 +217,12 @@ bool asst::AbstractTask::save_img(const std::string& dirname) asst::MinitouchTempSwitcher::MinitouchTempSwitcher(std::shared_ptr ctrler) : m_ctrler(ctrler) { + Log.info("Minitouch temporarily open"); m_ctrler->set_minitouch_enabled(true); } asst::MinitouchTempSwitcher::~MinitouchTempSwitcher() { + Log.info("Minitouch close"); m_ctrler->set_minitouch_enabled(false); } diff --git a/src/MeoAssistant/Task/Sub/ProcessTask.cpp b/src/MeoAssistant/Task/Sub/ProcessTask.cpp index 19416e9ed1..1eb4e62170 100644 --- a/src/MeoAssistant/Task/Sub/ProcessTask.cpp +++ b/src/MeoAssistant/Task/Sub/ProcessTask.cpp @@ -307,5 +307,6 @@ void ProcessTask::exec_click_task(const Rect& matched_rect) void asst::ProcessTask::exec_swipe_task(const Rect& r1, const Rect& r2, int duration, bool extra_swipe) { + MinitouchTempSwitcher switcher(m_ctrler); m_ctrler->swipe(r1, r2, duration, extra_swipe); }