chore: Add trace log for scaled coordinates in ControlScaleProxy click & swipe

This commit is contained in:
uye
2024-06-01 00:18:31 +08:00
parent 555baa78d0
commit f011e8c06b
3 changed files with 8 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
#include "ControlScaleProxy.h"
#include "Config/GeneralConfig.h"
#include "Utils/Logger.hpp"
asst::ControlScaleProxy::ControlScaleProxy(std::shared_ptr<ControllerAPI> controller, ControllerType controller_type,
ProxyCallback proxy_callback)
@@ -56,6 +57,8 @@ bool asst::ControlScaleProxy::click(const Point& p)
int x = static_cast<int>(p.x * m_control_scale);
int y = static_cast<int>(p.y * m_control_scale);
Log.trace("Click with scaled coordinates", p, m_control_scale);
return m_controller->click(Point(x, y));
}
@@ -72,6 +75,8 @@ bool asst::ControlScaleProxy::swipe(const Point& p1, const Point& p2, int durati
int x2 = static_cast<int>(p2.x * m_control_scale);
int y2 = static_cast<int>(p2.y * m_control_scale);
Log.trace("Swipe with scaled coordinates", p1, p2, m_control_scale);
return m_controller->swipe(Point(x1, y1), Point(x2, y2), duration, extra_swipe, slope_in, slope_out, with_pause);
}