fix predefined win forbidden cursor

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-11-22 21:34:53 +08:00
parent 3162c92333
commit edab4fd62d
3 changed files with 88 additions and 84 deletions

View File

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