Skip to content

Commit

Permalink
fix: 修复minitouch某些模拟器上点按位置错误
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Nov 30, 2023
1 parent 55434ce commit ed0172c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/MaaAdbControlUnit/Input/MtouchHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ed0172c

Please sign in to comment.