diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index f1f89f5e2..67e3f4a0f 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -2995,7 +2995,9 @@ class PredefinedCursor { () async { _image?.dispose(); - // PNG stores straight alpha; let the codec prepare the pixels for ui.Image. + // Native registration uses this ui.Image. The RGBA bytes from img2 are + // straight alpha, but PixelFormat.rgba8888 requires premultiplied alpha. + // Decode the PNG directly to preserve translucent cursor colors. final codec = await ui.instantiateImageCodec(pngBytes); final ui.Image nativeImage; try { diff --git a/src/platform/macos.rs b/src/platform/macos.rs index 70883dba8..b533f6d57 100644 --- a/src/platform/macos.rs +++ b/src/platform/macos.rs @@ -638,6 +638,9 @@ fn unsafe_get_cursor_data(hcursor: u64) -> ResultType { if hcursor != hcursor2 { bail!("cursor changed"); } + // NSImage.size is in points; using it as bitmap dimensions can crop Retina + // artwork. Render the full image and convert its hotspot to pixels; + // keep the existing 1x sampling path below. if scale > 1.0 { return cursor::data(c, hcursor, scale); }