Browse Source

Pull request #3886: REPORT-50662 设计器运行一段时间后会卡死

Merge in DESIGN/design from ~HADES/design:final/10.0 to final/10.0

* commit 'b5dee97f77a922bbb5f709712a2c753101438367':
  REPORT-50662 fix ;
  REPORT-50662 设计器运行一段时间后会卡死
final/10.0
Kara 4 years ago
parent
commit
f141bf91c1
  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