Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
c168b7e979
commit
004c2e069c
@ -181,6 +181,8 @@ class InputModel {
|
|||||||
|
|
||||||
var _lastScale = 1.0;
|
var _lastScale = 1.0;
|
||||||
|
|
||||||
|
bool _pointerMovedAfterEnter = false;
|
||||||
|
|
||||||
// mouse
|
// mouse
|
||||||
final isPhysicalMouse = false.obs;
|
final isPhysicalMouse = false.obs;
|
||||||
int _lastButtons = 0;
|
int _lastButtons = 0;
|
||||||
@ -441,6 +443,7 @@ class InputModel {
|
|||||||
|
|
||||||
void enterOrLeave(bool enter) {
|
void enterOrLeave(bool enter) {
|
||||||
toReleaseKeys.release(handleRawKeyEvent);
|
toReleaseKeys.release(handleRawKeyEvent);
|
||||||
|
_pointerMovedAfterEnter = false;
|
||||||
|
|
||||||
// Fix status
|
// Fix status
|
||||||
if (!enter) {
|
if (!enter) {
|
||||||
@ -778,6 +781,7 @@ class InputModel {
|
|||||||
type = 'up';
|
type = 'up';
|
||||||
break;
|
break;
|
||||||
case _kMouseEventMove:
|
case _kMouseEventMove:
|
||||||
|
_pointerMovedAfterEnter = true;
|
||||||
isMove = true;
|
isMove = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -785,6 +789,12 @@ class InputModel {
|
|||||||
}
|
}
|
||||||
evt['type'] = type;
|
evt['type'] = type;
|
||||||
|
|
||||||
|
if (type == 'down' && !_pointerMovedAfterEnter) {
|
||||||
|
// Move mouse to the position of the down event first.
|
||||||
|
lastMousePos = ui.Offset(x, y);
|
||||||
|
refreshMousePos();
|
||||||
|
}
|
||||||
|
|
||||||
final pos = handlePointerDevicePos(
|
final pos = handlePointerDevicePos(
|
||||||
kPointerEventKindMouse,
|
kPointerEventKindMouse,
|
||||||
x,
|
x,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user