fix: 修复已打开应用缩略图显示位置偏差

原来的逻辑中将显示位置进行了偏移导致显示位置与实际位置有偏差,将偏移相关部分移除即可

Log: 修复应用打开窗口预览图显示错误
Influence: 鼠标放入到已经打开的应用的上方,观察预览图的位置显示是否正常
Bug: https://pms.uniontech.com/bug-view-165775.html
Change-Id: I14fbd7cfd7dc54f76371f1bdfe49cc651ac85d97
This commit is contained in:
donghualin 2022-11-14 02:37:20 +00:00
parent 8a01a93424
commit 305f1ba8fb

View File

@ -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;