docs(cursor): clarify optional capture metadata and rendering scope

This commit is contained in:
fufesou
2026-09-12 10:46:05 +08:00
parent 54881092b7
commit 6871ae130e
3 changed files with 6 additions and 3 deletions

View File

@@ -1116,6 +1116,8 @@ class _ImagePaintState extends State<ImagePaint> {
if (!isWeb && isViewScaled() && !zoomCursor.value && peerDpr > 0) {
return (isWindows ? dpr : 1.0) / peerDpr;
}
// Density metadata is optional. Keep the legacy path for hosts that
// omit it so capture-backend upgrades are not a client prerequisite.
var cursorScale = 1.0;
if (isWindows) {
// debug win10

View File

@@ -2850,7 +2850,8 @@ class CanvasModel with ChangeNotifier {
}
}
// data for cursor
// Scale the host's bitmap and hotspot together. Incorrect source geometry
// must be fixed in host capture, independently of the client's sizing policy.
class CursorData {
final String peerId;
final String id;
@@ -2858,7 +2859,7 @@ class CursorData {
// Borrowed from CursorModel/PredefinedCursor, which own its lifetime.
// The plugin clones the handle before starting asynchronous encoding.
final ui.Image nativeImage;
// Zero preserves sizing for peers that predate cursor density metadata.
// Zero preserves legacy sizing for capture backends without density metadata.
final double pixelRatio;
double scale;
Uint8List? data;

View File

@@ -316,7 +316,7 @@ message CursorData {
int32 width = 4;
int32 height = 5;
bytes colors = 6;
// Physical bitmap pixels per remote logical pixel; 0 means an older sender.
// Physical bitmap pixels per remote logical pixel; 0 means unknown density.
double scale = 7;
}