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)