Preserve legacy macOS cursor dimensions with optional Retina artwork

This commit is contained in:
fufesou
2026-09-13 23:17:21 +08:00
parent 819535f1db
commit fbfa37c8fd
7 changed files with 78 additions and 9 deletions

View File

@@ -1118,7 +1118,10 @@ class _ImagePaintState extends State<ImagePaint> {
? cursor.cache ?? preDefaultCursor.cache
: preForbiddenCursor.cache;
final peerDpr = cache?.pixelRatio ?? 0;
if (!isWeb && isViewScaled() && zoomCursor.isFalse && peerDpr > 0) {
if (isViewScaled() && zoomCursor.isFalse && peerDpr > 0 &&
(!isWeb || widget.ffi.ffiModel.pi.platform == kPeerPlatformMacOS)) {
// Retina export is physical-sized; Web must undo that change too.
// Other Web host bitmaps retain their existing sizing policy.
// Adaptive/Custom scales the video, but Zoom cursor is off: preserve the
// cursor's logical size instead of multiplying it by the canvas scale.
// Divide by the source bitmap density to obtain logical cursor pixels.