From d8133e3c97ccd5dd2907bf0f9f7334be8e8eb391 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: Fri, 13 Sep 2024 10:25:03 +0800 Subject: [PATCH] fix --- .../LunaTranslator/rendertext/textbrowser_imp/yinying.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/yinying.py b/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/yinying.py index 2465b768..316ee004 100644 --- a/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/yinying.py +++ b/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/yinying.py @@ -21,7 +21,7 @@ class CachedQGraphicsDropShadowEffect_multi(QGraphicsDropShadowEffect): def draw(self, painter): r = self.parent().devicePixelRatioF() - if self.shadow_pixmap.isNull() or self.savey != self.parent().y(): + if self.shadow_pixmap.isNull(): size = QSize(painter.device().width(), painter.device().height()) * r self.shadow_pixmap = QPixmap(size) @@ -31,11 +31,11 @@ class CachedQGraphicsDropShadowEffect_multi(QGraphicsDropShadowEffect): shadow_painter.setRenderHint(QPainter.RenderHint.Antialiasing) for _ in range(self.x): super().draw(shadow_painter) - self.savey = self.parent().y() + self.savey = self.parent().y() painter.setRenderHint(QPainter.RenderHint.Antialiasing) painter.drawPixmap( -int(self.parent().x()), - -int(self.parent().y()) - self.parent().parent().parent().parent().y(), + -self.parent().parent().parent().parent().y() - self.savey, self.shadow_pixmap, )