fix: android, pan, canvas, remove toInt() (#10103)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2024-11-29 22:39:07 +08:00 committed by GitHub
parent b91b49229a
commit b32ff87c6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 27 deletions

View file

@ -2184,7 +2184,7 @@ class CursorModel with ChangeNotifier {
if (dx == 0 && dy == 0) return;
Point? newPos;
Point<double>? newPos;
final rect = parent.target?.ffiModel.rect;
if (rect == null) {
// unreachable
@ -2195,8 +2195,8 @@ class CursorModel with ChangeNotifier {
parent.target?.ffiModel.pi.platform,
kPointerEventKindMouse,
kMouseEventTypeDefault,
(_x + dx).toInt(),
(_y + dy).toInt(),
_x + dx,
_y + dy,
rect,
buttons: kPrimaryButton);
if (newPos == null) {
@ -2204,8 +2204,8 @@ class CursorModel with ChangeNotifier {
}
dx = newPos.x - _x;
dy = newPos.y - _y;
_x = newPos.x.toDouble();
_y = newPos.y.toDouble();
_x = newPos.x;
_y = newPos.y;
if (tryMoveCanvasX && dx != 0) {
parent.target?.canvasModel.panX(-dx * scale);
}