From c2ff269b5f41a6b8ec7556ec86ef7f6eeb6fe635 Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 19 Sep 2023 23:49:17 +0800 Subject: [PATCH] fix, scale adaptive blurry Signed-off-by: dignow --- flutter/lib/desktop/pages/remote_page.dart | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index d2d7534ab..305782e7a 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -485,21 +485,20 @@ class _ImagePaintState extends State { var c = Provider.of(context); final s = c.scale; + bool isViewAdaptive() => c.viewStyle.style == kRemoteViewStyleAdaptive; + bool isViewOriginal() => c.viewStyle.style == kRemoteViewStyleOriginal; + mouseRegion({child}) => Obx(() { double getCursorScale() { var c = Provider.of(context); var cursorScale = 1.0; if (Platform.isWindows) { // debug win10 - final isViewAdaptive = - c.viewStyle.style == kRemoteViewStyleAdaptive; - if (zoomCursor.value && isViewAdaptive) { + if (zoomCursor.value && isViewAdaptive()) { cursorScale = s * c.devicePixelRatio; } } else { - final isViewOriginal = - c.viewStyle.style == kRemoteViewStyleOriginal; - if (zoomCursor.value || isViewOriginal) { + if (zoomCursor.value || isViewOriginal()) { cursorScale = s; } } @@ -541,7 +540,8 @@ class _ImagePaintState extends State { height: imageHeight, child: Obx(() => Texture( textureId: widget.textureId.value, - filterQuality: FilterQuality.none, + filterQuality: + isViewOriginal() ? FilterQuality.none : FilterQuality.low, )), ); } else { @@ -587,7 +587,8 @@ class _ImagePaintState extends State { height: c.getDisplayHeight() * s, child: Texture( textureId: widget.textureId.value, - filterQuality: FilterQuality.none, + filterQuality: + isViewOriginal() ? FilterQuality.none : FilterQuality.low, ), ) ],