fix mouse out of bounds
This commit is contained in:
parent
406be63ffd
commit
ccb60ace8f
@ -1240,8 +1240,8 @@ class FFI {
|
||||
return;
|
||||
}
|
||||
evt['type'] = type;
|
||||
var x = evt['x'];
|
||||
var y = max(0.0, (evt['y'] as double) - tabBarHeight);
|
||||
double x = evt['x'];
|
||||
double y = max(0.0, (evt['y'] as double) - tabBarHeight);
|
||||
if (isMove) {
|
||||
canvasModel.moveDesktopMouse(x, y);
|
||||
}
|
||||
@ -1264,9 +1264,6 @@ class FFI {
|
||||
y -= canvasModel.y;
|
||||
}
|
||||
|
||||
if (!isMove && (x < 0 || x > d.width || y < 0 || y > d.height)) {
|
||||
return;
|
||||
}
|
||||
x /= canvasModel.scale;
|
||||
y /= canvasModel.scale;
|
||||
x += d.x;
|
||||
@ -1275,6 +1272,9 @@ class FFI {
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
// fix mouse out of bounds
|
||||
x = min(max(0.0, x), d.width.toDouble());
|
||||
y = min(max(0.0, y), d.height.toDouble());
|
||||
evt['x'] = '${x.round()}';
|
||||
evt['y'] = '${y.round()}';
|
||||
var buttons = '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user