From 868250cd7b6f02da1a35130506b544295b201e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Sat, 29 Jun 2024 00:48:44 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/gui/showocrimage.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/showocrimage.py b/LunaTranslator/LunaTranslator/gui/showocrimage.py index 91346ba1..8e39da68 100644 --- a/LunaTranslator/LunaTranslator/gui/showocrimage.py +++ b/LunaTranslator/LunaTranslator/gui/showocrimage.py @@ -16,10 +16,8 @@ class pixlabel(QLabel): if self.pix: painter = QPainter(self) painter.setRenderHint(QPainter.RenderHint.Antialiasing) - pix = QPixmap(self.size() * self.devicePixelRatioF()) - pix.fill(Qt.GlobalColor.transparent) - paintpix = QPainter(pix) - paintpix.drawPixmap( + + painter.drawPixmap( 0, 0, self.pix.scaled( @@ -28,8 +26,6 @@ class pixlabel(QLabel): Qt.TransformationMode.SmoothTransformation, ), ) - paintpix.end() - painter.drawPixmap(0, 0, pix) return super().paintEvent(a0)