From 305f1ba8fb3d377e28cf40d7e02d5dffbbf215c1 Mon Sep 17 00:00:00 2001 From: donghualin Date: Mon, 14 Nov 2022 02:37:20 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B7=B2=E6=89=93?= =?UTF-8?q?=E5=BC=80=E5=BA=94=E7=94=A8=E7=BC=A9=E7=95=A5=E5=9B=BE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BD=8D=E7=BD=AE=E5=81=8F=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原来的逻辑中将显示位置进行了偏移导致显示位置与实际位置有偏差,将偏移相关部分移除即可 Log: 修复应用打开窗口预览图显示错误 Influence: 鼠标放入到已经打开的应用的上方,观察预览图的位置显示是否正常 Bug: https://pms.uniontech.com/bug-view-165775.html Change-Id: I14fbd7cfd7dc54f76371f1bdfe49cc651ac85d97 --- frame/item/components/appsnapshot.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/frame/item/components/appsnapshot.cpp b/frame/item/components/appsnapshot.cpp index 25b6f01fc..2c08509b9 100644 --- a/frame/item/components/appsnapshot.cpp +++ b/frame/item/components/appsnapshot.cpp @@ -305,14 +305,10 @@ void AppSnapshot::paintEvent(QPaintEvent *e) painter.drawRoundedRect(rect(), 5, 5); } - const qreal offset_x = width() / 2.0 - SNAP_WIDTH / ratio / 2; - const qreal offset_y = height() / 2.0 - SNAP_HEIGHT / ratio / 2; - DStyleHelper dstyle(style()); const int radius = dstyle.pixelMetric(DStyle::PM_FrameRadius); painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); - painter.translate(QPoint(offset_x * ratio, offset_y * ratio)); QRect imageRect(8, 8, width() - 16, height() - 16); painter.setPen(Qt::NoPen); QPainterPath path;