From 8aee2a442e1e12a557d14f7cb3d003836010d955 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Thu, 10 Sep 2026 14:09:39 +0800 Subject: [PATCH] fix(flutter): keep the painted cursor hotspot in place when zoom cursor is off `CursorPaint` subtracted the hotspot in remote pixels and then scaled it by the canvas scale, but drew the image at scale 1.0, so the hotspot landed hotx * (1 - scale) logical pixels away from the remote cursor position. Cursors with a centered hotspot (I-beam, crosshair) were off by up to half their size in Adaptive view. Subtract the hotspot after scaling the position instead. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01K8HSHTEHo27mDcJXVyVfSP --- flutter/lib/desktop/pages/remote_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index 5e392d99f..4be4430e9 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -1410,8 +1410,8 @@ class CursorPaint extends StatelessWidget { } } - double x = (m.x - hotx) * c.scale + cx; - double y = (m.y - hoty) * c.scale + cy; + double x = m.x * c.scale + cx - hotx; + double y = m.y * c.scale + cy - hoty; double scale = 1.0; final isViewOriginal = c.viewStyle.style == kRemoteViewStyleOriginal; if (zoomCursor.value || isViewOriginal) {