Merge pull request #3158 from fufesou/fix/mouse_control_in_black_blank

mouse do not control in black blank area
This commit is contained in:
RustDesk 2023-02-10 21:40:26 +08:00 committed by GitHub
commit 397f6996ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -485,10 +485,19 @@ class InputModel {
y /= canvasModel.scale; y /= canvasModel.scale;
x += d.x; x += d.x;
y += d.y; y += d.y;
if (x < d.x || y < d.y || x > (d.x + d.width) || y > (d.y + d.height)) {
// If left mouse up, no early return.
if (evt['buttons'] != kPrimaryMouseButton || type != 'up') {
return;
}
}
if (type != '') { if (type != '') {
x = 0; x = 0;
y = 0; y = 0;
} }
evt['x'] = '${x.round()}'; evt['x'] = '${x.round()}';
evt['y'] = '${y.round()}'; evt['y'] = '${y.round()}';
var buttons = ''; var buttons = '';