From ed0172ceb87200227e166d1e8a14a08298237252 Mon Sep 17 00:00:00 2001 From: MistEO Date: Fri, 1 Dec 2023 00:17:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dminitouch=E6=9F=90?= =?UTF-8?q?=E4=BA=9B=E6=A8=A1=E6=8B=9F=E5=99=A8=E4=B8=8A=E7=82=B9=E6=8C=89?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/MaaAdbControlUnit/Input/MtouchHelper.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/MaaAdbControlUnit/Input/MtouchHelper.cpp b/source/MaaAdbControlUnit/Input/MtouchHelper.cpp index 8f006c51f..77cb97b32 100644 --- a/source/MaaAdbControlUnit/Input/MtouchHelper.cpp +++ b/source/MaaAdbControlUnit/Input/MtouchHelper.cpp @@ -61,8 +61,9 @@ bool MtouchHelper::read_info(int swidth, int sheight, int orientation) screen_width_ = swidth; screen_height_ = sheight; - touch_width_ = x; - touch_height_ = y; + bool landscape = screen_width_ > screen_height_; + touch_width_ = landscape ? std::max(x, y) : std::min(x, y); + touch_height_ = landscape ? std::min(x, y) : std::max(x, y); xscale_ = double(touch_width_) / swidth; yscale_ = double(touch_height_) / sheight; press_ = pressure;