From 1f789f8b16c3d4b02c4683bbab38c5d00a5a4e4e 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 09:57:32 +0800 Subject: [PATCH] fix --- .../LunaTranslator/rendertext/textbrowser_imp/yinying.py | 5 ++++- plugins/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/yinying.py b/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/yinying.py index 5608491c..2465b768 100644 --- a/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/yinying.py +++ b/LunaTranslator/LunaTranslator/rendertext/textbrowser_imp/yinying.py @@ -17,10 +17,12 @@ class CachedQGraphicsDropShadowEffect_multi(QGraphicsDropShadowEffect): super().__init__(parent) self.shadow_pixmap = QPixmap() self.x = x + self.savey = None def draw(self, painter): r = self.parent().devicePixelRatioF() - if self.shadow_pixmap.isNull(): + if self.shadow_pixmap.isNull() or self.savey != self.parent().y(): + size = QSize(painter.device().width(), painter.device().height()) * r self.shadow_pixmap = QPixmap(size) self.shadow_pixmap.setDevicePixelRatio(r) @@ -29,6 +31,7 @@ class CachedQGraphicsDropShadowEffect_multi(QGraphicsDropShadowEffect): shadow_painter.setRenderHint(QPainter.RenderHint.Antialiasing) for _ in range(self.x): super().draw(shadow_painter) + self.savey = self.parent().y() painter.setRenderHint(QPainter.RenderHint.Antialiasing) painter.drawPixmap( -int(self.parent().x()), diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index b8d81285..3070e19a 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -29,7 +29,7 @@ include(generate_product_version) set(VERSION_MAJOR 5) set(VERSION_MINOR 35) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)