fix remote cursor pos

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-12-30 16:14:30 +08:00
parent 2d93c93bc4
commit 56041a5aac
3 changed files with 21 additions and 11 deletions

View File

@@ -316,8 +316,8 @@ class _RemotePageState extends State<RemotePage>
];
if (!_ffi.canvasModel.cursorEmbeded) {
paints.add(Obx(() => Visibility(
visible: _showRemoteCursor.isTrue && _remoteCursorMoved.isTrue,
paints.add(Obx(() => Offstage(
offstage: _showRemoteCursor.isFalse || _remoteCursorMoved.isFalse,
child: CursorPaint(
id: widget.id,
zoomCursor: _zoomCursor,
@@ -617,7 +617,8 @@ class CursorPaint extends StatelessWidget {
double cx = c.x;
double cy = c.y;
if (c.scrollStyle == ScrollStyle.scrollbar) {
if (c.viewStyle.style == kRemoteViewStyleOriginal &&
c.scrollStyle == ScrollStyle.scrollbar) {
final d = c.parent.target!.ffiModel.display;
final imageWidth = d.width * c.scale;
final imageHeight = d.height * c.scale;
@@ -626,7 +627,7 @@ class CursorPaint extends StatelessWidget {
}
double x = (m.x - hotx) * c.scale + cx;
double y = (m.y - hoty) * c.scale + cx;
double y = (m.y - hoty) * c.scale + cy;
double scale = 1.0;
if (zoomCursor.isTrue) {
x = m.x - hotx + cx / c.scale;

View File

@@ -365,8 +365,6 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
RxInt display = CurrentDisplayState.find(widget.id);
if (display.value != i) {
bind.sessionSwitchDisplay(id: widget.id, value: i);
pi.currentDisplay = i;
display.value = i;
}
},
)