From 22a35c9b8629f64c800c3e60353475eb4a9818c4 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: Thu, 11 Apr 2024 21:12:39 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/gui/specialwidget.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/LunaTranslator/LunaTranslator/gui/specialwidget.py b/LunaTranslator/LunaTranslator/gui/specialwidget.py index a650961c..82fbc5b5 100644 --- a/LunaTranslator/LunaTranslator/gui/specialwidget.py +++ b/LunaTranslator/LunaTranslator/gui/specialwidget.py @@ -59,7 +59,15 @@ class chartwidget(QWidget): xmargin = xmargin + self.scalelinelen - width = self.width() - xmargin - self.fmetrics.width(x_labels[-1]) // 2 + width = ( + self.width() + - xmargin + - max( + self.fmetrics.width(x_labels[-1]) // 2, + self.fmetrics.width(self.ytext(self.data[-1][1])) // 2, + ) + ) + height = self.height() - 2 * ymargin # 纵坐标