From 01740e564e8381cfc9162e10156e0cd465e0a3c7 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 2 Apr 2021 15:01:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-50662=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E4=B8=80=E6=AE=B5=E6=97=B6=E9=97=B4=E5=90=8E?= =?UTF-8?q?=E4=BC=9A=E5=8D=A1=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/utils/gui/GUIPaintUtils.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java index c4efc0282..645bfdef1 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java @@ -4,12 +4,15 @@ import com.fr.base.vcs.DesignerMode; import com.fr.design.constants.UIConstants; import com.fr.stable.Constants; +import com.fr.stable.os.OperatingSystem; import java.awt.*; import java.awt.geom.GeneralPath; import java.awt.geom.RoundRectangle2D; public class GUIPaintUtils { + private static boolean macos = OperatingSystem.isMacos(); + public static final void drawBorder(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection) { drawBorder(g2d, x, y, width, height, isRound, rectDirection, false); } @@ -39,10 +42,14 @@ public class GUIPaintUtils { g2d.drawLine(x, y, x, height - 1); g2d.drawLine(x, height - 1, x + 3, height - 1); } else { - double offsetX = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleX() - 1, 0.5d); - double offsetY = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleY() - 1, 0.5d); - Shape shape = new RoundRectangle2D.Double(x + offsetX, y + offsetY, width - 1d, height - 1d, UIConstants.ARC, UIConstants.ARC); - g2d.draw(shape); + if (macos) { + g2d.drawRoundRect(x, y, width - 1, height - 1, UIConstants.ARC, UIConstants.ARC) + } else { + double offsetX = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleX() - 1, 0.5d); + double offsetY = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleY() - 1, 0.5d); + Shape shape = new RoundRectangle2D.Double(x + offsetX, y + offsetY, width - 1d, height - 1d, UIConstants.ARC, UIConstants.ARC); + g2d.draw(shape); + } } g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); } else { From b5dee97f77a922bbb5f709712a2c753101438367 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 2 Apr 2021 15:12:49 +0800 Subject: [PATCH 2/2] REPORT-50662 fix ; --- .../src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java index 645bfdef1..fb530fd92 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java @@ -43,7 +43,7 @@ public class GUIPaintUtils { g2d.drawLine(x, height - 1, x + 3, height - 1); } else { if (macos) { - g2d.drawRoundRect(x, y, width - 1, height - 1, UIConstants.ARC, UIConstants.ARC) + g2d.drawRoundRect(x, y, width - 1, height - 1, UIConstants.ARC, UIConstants.ARC); } else { double offsetX = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleX() - 1, 0.5d); double offsetY = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleY() - 1, 0.5d);