mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-04-20 03:25:03 +00:00
fixclicks
This commit is contained in:
parent
560ec69f3b
commit
80bacf44ca
1 changed files with 6 additions and 3 deletions
|
@ -617,9 +617,12 @@ screen_convert_to_frame_coords(struct screen *screen, int32_t x, int32_t y) {
|
|||
|
||||
LOGI("window_size = %dx%d, drawable_size = %dx%d", ww, wh, dw, dh);
|
||||
|
||||
// scale (64 bits for intermediate multiplications)
|
||||
x = (int64_t) (x - screen->rect.x) * w * dw / (screen->rect.w * ww);
|
||||
y = (int64_t) (y - screen->rect.y) * h * dh / (screen->rect.h * wh);
|
||||
// scale for HiDPI (64 bits for intermediate multiplications)
|
||||
x = (int64_t) x * dw / ww;
|
||||
y = (int64_t) y * dh / wh;
|
||||
|
||||
x = (int64_t) (x - screen->rect.x) * w / screen->rect.w;
|
||||
y = (int64_t) (y - screen->rect.y) * h / screen->rect.h;
|
||||
|
||||
LOGI("content=%dx%d, rect={%d, %d, %dx%d}: (%d, %d) -> (%d, %d)",
|
||||
(int) w, (int) h,
|
||||
|
|
Loading…
Add table
Reference in a new issue