From 06f3a08b9c742494b3eda4d45dbdbe9f9693301c 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: Wed, 19 Jun 2024 09:15:34 +0800 Subject: [PATCH] zoom --- LunaTranslator/LunaTranslator/gui/usefulwidget.py | 3 +++ LunaTranslator/LunaTranslator/rendertext/webview.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/LunaTranslator/LunaTranslator/gui/usefulwidget.py b/LunaTranslator/LunaTranslator/gui/usefulwidget.py index 79229204..ba4038fe 100644 --- a/LunaTranslator/LunaTranslator/gui/usefulwidget.py +++ b/LunaTranslator/LunaTranslator/gui/usefulwidget.py @@ -795,6 +795,9 @@ class WebivewWidget(abstractwebview): def set_zoom(self, zoom): self.put_ZoomFactor(zoom) + def get_ZoomFactor(self): + return winsharedutils.get_ZoomFactor(self.get_controller()) + def put_ZoomFactor(self, zoom): winsharedutils.put_ZoomFactor(self.get_controller(), zoom) diff --git a/LunaTranslator/LunaTranslator/rendertext/webview.py b/LunaTranslator/LunaTranslator/rendertext/webview.py index 5a8c7c79..b9e3e213 100644 --- a/LunaTranslator/LunaTranslator/rendertext/webview.py +++ b/LunaTranslator/LunaTranslator/rendertext/webview.py @@ -91,7 +91,9 @@ class TextBrowser(QWidget, dataget): pass def calllunaheightchange(self, h): - self.contentsChanged.emit(QSize(self.width(), h)) + self.contentsChanged.emit( + QSize(self.width(), h * self.webivewwidget.get_ZoomFactor()) + ) def internalheighchange(self): self.testeval(