fix(flutter): preserve cursor minimum sizes and native hotspots

This commit is contained in:
fufesou
2026-09-11 13:51:24 +08:00
parent d202a2fba4
commit 7bb3fe6b5a
3 changed files with 65 additions and 26 deletions

View File

@@ -16,8 +16,8 @@ deleteCustomCursor(String key) =>
resetSystemCursor() {}
double _nativeHotspot(double hotspot, int bitmapSize) {
if (!isLinux) return hotspot;
// GDK takes integer hotspots inside the bitmap; avoid truncating toward zero.
if (!isLinux && !isWindows) return hotspot;
// GDK and Win32 take integer hotspots inside the bitmap; use the nearest pixel.
return min(hotspot.round(), bitmapSize - 1).toDouble();
}