cursor pos linux

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-11-13 19:35:59 -08:00
parent a3afb03109
commit 60a30042c0
3 changed files with 17 additions and 14 deletions

View File

@@ -866,15 +866,15 @@ class CursorPaint extends StatelessWidget {
double hoty = m.hoty;
if (m.image == null) {
if (m.defaultCache != null) {
hotx = m.defaultCache!.hotx;
hoty = m.defaultCache!.hoty;
hotx = m.defaultImage!.width / 2;
hoty = m.defaultImage!.height / 2;
}
}
return CustomPaint(
painter: ImagePainter(
image: m.image ?? m.defaultImage,
x: m.x * s - hotx + c.x,
y: m.y * s - hoty + c.y - adjust,
x: m.x * s - hotx * s + c.x,
y: m.y * s - hoty * s + c.y - adjust,
scale: 1),
);
}