From 5d277b9835f9a10ca15f3df2910819e91a7c543b Mon Sep 17 00:00:00 2001 From: Harrison Date: Mon, 13 Jun 2022 14:15:43 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-73262=E3=80=90=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=8E=AF=E5=A2=83=E7=9B=91=E6=B5=8B=E3=80=91=E5=8F=B3?= =?UTF-8?q?=E4=B8=8B=E8=A7=92=E5=BC=B9=E7=AA=97=E6=96=87=E5=AD=97=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E5=85=A8=20rt,=20=E4=BD=BF=E7=94=A8=20scroll?= =?UTF-8?q?Panel=20=E7=9A=84=E6=97=B6=E5=80=99=E9=9C=80=E8=A6=81=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/components/notification/NotificationDialog.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/components/notification/NotificationDialog.java b/designer-base/src/main/java/com/fr/design/components/notification/NotificationDialog.java index 4be51f1a14..a4935b30ca 100644 --- a/designer-base/src/main/java/com/fr/design/components/notification/NotificationDialog.java +++ b/designer-base/src/main/java/com/fr/design/components/notification/NotificationDialog.java @@ -184,7 +184,10 @@ public class NotificationDialog extends JDialog { int widthUnit = messageComponents.stream() .map((component) -> { Dimension preferredSize = component.getPreferredSize(); - return preferredSize.getHeight(); + double width = preferredSize.getWidth(); + double widthFactor = Math.ceil(width / CONTENT_WIDTH); + // 这里的高度是没有限制宽度的,如果限制宽度,高度会变更,所以这里需要加上宽度的影响 + return preferredSize.getHeight() + widthFactor * SIGN_LABEL_DIMENSION.getHeight(); }) .reduce(Double::sum) .map(calStandardWidth)