mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-17 18:01:06 +03:00
docs(cursor): explain image decoding and Retina sampling
This commit is contained in:
@@ -2995,7 +2995,9 @@ class PredefinedCursor {
|
|||||||
|
|
||||||
() async {
|
() async {
|
||||||
_image?.dispose();
|
_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 codec = await ui.instantiateImageCodec(pngBytes);
|
||||||
final ui.Image nativeImage;
|
final ui.Image nativeImage;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -638,6 +638,9 @@ fn unsafe_get_cursor_data(hcursor: u64) -> ResultType<CursorData> {
|
|||||||
if hcursor != hcursor2 {
|
if hcursor != hcursor2 {
|
||||||
bail!("cursor changed");
|
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 {
|
if scale > 1.0 {
|
||||||
return cursor::data(c, hcursor, scale);
|
return cursor::data(c, hcursor, scale);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user