From cb1a06270e263174d9b675516196c26509fe36ed Mon Sep 17 00:00:00 2001 From: dignow Date: Tue, 19 Sep 2023 22:57:53 +0800 Subject: [PATCH] fix, set texture widget offset to int on linux Signed-off-by: dignow --- flutter/lib/desktop/pages/remote_page.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index f38e7d16c..d2d7534ab 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -576,11 +576,13 @@ class _ImagePaintState extends State { late final Widget imageWidget; if (c.size.width > 0 && c.size.height > 0) { if (widget.useTextureRender) { + final x = Platform.isLinux ? c.x.toInt().toDouble() : c.x; + final y = Platform.isLinux ? c.y.toInt().toDouble() : c.y; imageWidget = Stack( children: [ Positioned( - left: c.x, - top: c.y, + left: x, + top: y, width: c.getDisplayWidth() * s, height: c.getDisplayHeight() * s, child: Texture(