From 323d0e65dbaa993356e8c195f830c7604899e790 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, 31 Jul 2024 01:15:29 +0800 Subject: [PATCH] eh --- LunaTranslator/LunaTranslator/rendertext/textbrowser.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/LunaTranslator/LunaTranslator/rendertext/textbrowser.py b/LunaTranslator/LunaTranslator/rendertext/textbrowser.py index 4a1572f2..82b1bba2 100644 --- a/LunaTranslator/LunaTranslator/rendertext/textbrowser.py +++ b/LunaTranslator/LunaTranslator/rendertext/textbrowser.py @@ -395,6 +395,8 @@ class TextBrowser(QWidget, dataget): fh = globalconfig["extra_space"] fha, _ = self._getfh(True) self.extra_height = fha + if fh < 0: + self.extra_height = max(-fh, self.extra_height) for i in range(b1, b2): _fha = 0 for word in linetags[i - b1]: @@ -417,8 +419,10 @@ class TextBrowser(QWidget, dataget): fh = globalconfig["extra_space"] else: fh = globalconfig["extra_space_trans"] - - self.extra_height = 0 + if fh < 0: + self.extra_height = -fh + else: + self.extra_height = 0 for i in range(b1, b2): b = self.textbrowser.document().findBlockByNumber(i) tf = b.blockFormat()