Browse Source

Merge pull request #3895 in DESIGN/design from final/10.0 to bugfix/10.0

* commit 'f141bf91c14468ce8e2f0ed9ded61b81a79fd27a':
  REPORT-50662 fix ;
  REPORT-50662 设计器运行一段时间后会卡死
bugfix/10.0
superman 4 years ago
parent
commit
09e3cd5450
  1. 7
      designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java

7
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);
}
@ -38,12 +41,16 @@ public class GUIPaintUtils {
g2d.drawLine(x, y, x + 2, y);
g2d.drawLine(x, y, x, height - 1);
g2d.drawLine(x, height - 1, x + 3, height - 1);
} else {
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 {
g2d.drawRect(x, y, width, height);

Loading…
Cancel
Save