Browse Source

REPORT-59237 继续优化判断绘制间距线的地方代码

fix-lag
方磊 3 years ago
parent
commit
8feffddfc0
  1. 33
      designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java

33
designer-form/src/main/java/com/fr/design/mainframe/FormSpacingLineDrawer.java

@ -137,43 +137,22 @@ public class FormSpacingLineDrawer {
GraphDrawHelper.drawString(g2d, text, labelX, labelY);
}
private boolean isSelectedParaComponent() {
return designer.getParaComponent() == selectedCreator;
}
private boolean isSelectedRootComponent() {
return designer.isRoot(selectedCreator);
}
private boolean isSelectedForm() {
return selectedCreator.getParent() == null;
}
private boolean isNeedExtendedLine(AbstractFormParallelLine[] nearestSides) {
return nearestSides[0].isVerticalCenterLineBeforeTheParallelLine(nearestSides[1]) || nearestSides[0].isVerticalCenterLineBehindTheParallelLine(nearestSides[1]);
}
private boolean isSelectedRootPane() {
// form、body、para这三个选中了,都不要画任何间距线
return isSelectedForm() || isSelectedRootComponent() || isSelectedParaComponent();
}
// 当前组件是否在参数面板里面
private boolean isCompInBody(XCreator creator) {
private boolean isComponentInBody(XCreator creator) {
XLayoutContainer container = XCreatorUtils.getHotspotContainer(creator);
return container != null && !container.acceptType(XWParameterLayout.class);
}
private boolean isSelectedCompInBody() {
return isCompInBody(selectedCreator);
}
private boolean isHoveredCompInBody() {
return isCompInBody(hoverCreator);
private boolean isSelectedComponentInBody() {
return isComponentInBody(selectedCreator);
}
private boolean isCompInBody() {
return isSelectedCompInBody() && isHoveredCompInBody();
private boolean isHoveredComponentInBody() {
return isComponentInBody(hoverCreator);
}
private boolean isBodyAbsoluteLayout() {
@ -185,7 +164,7 @@ public class FormSpacingLineDrawer {
}
private boolean isDrawSpacingLine() {
return isInAbsoluteLayout() && !isSelectedRootPane() && isCompInBody();
return isInAbsoluteLayout() && isSelectedComponentInBody() && isHoveredComponentInBody();
}
private AbstractFormParallelLine[] getNearestHorizontalSide() {

Loading…
Cancel
Save