Browse Source

REPORT-60901【固定布局-原布局推荐4.1】决策报表-自适应布局-jaimme那边出现了,拖拽组件到空白块中蓝色阴影显示偏移了

bugfix/11.0
kerry 3 years ago
parent
commit
039ec2ffdc
  1. 8
      designer-form/src/main/java/com/fr/design/designer/beans/painters/FRFixLayoutPainter.java
  2. 6
      designer-form/src/main/java/com/fr/design/designer/beans/painters/FROccupiedLayoutPainter.java

8
designer-form/src/main/java/com/fr/design/designer/beans/painters/FRFixLayoutPainter.java

@ -1,6 +1,5 @@
package com.fr.design.designer.beans.painters; package com.fr.design.designer.beans.painters;
import com.fr.design.designer.beans.painters.AbstractPainter;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XOccupiedLayout; import com.fr.design.designer.creator.XOccupiedLayout;
@ -36,8 +35,8 @@ public class FRFixLayoutPainter extends AbstractPainter {
@Override @Override
public void paint(Graphics g, int startX, int startY) { public void paint(Graphics g, int startX, int startY) {
super.paint(g, startX, startY); super.paint(g, startX, startY);
int x = hotspot.x - hotspot_bounds.x; int x = hotspot.x - hotspot_bounds.x ;
int y = hotspot.y - hotspot_bounds.y; int y = hotspot.y - hotspot_bounds.y ;
Component currentComp = container.getComponentAt(x, y); Component currentComp = container.getComponentAt(x, y);
if (currentComp == null) { if (currentComp == null) {
return; return;
@ -50,7 +49,8 @@ public class FRFixLayoutPainter extends AbstractPainter {
} else if (!((XCreator) currentComp).acceptType(XOccupiedLayout.class)) { } else if (!((XCreator) currentComp).acceptType(XOccupiedLayout.class)) {
state = OperateState.COMPONENT_REPLACE; state = OperateState.COMPONENT_REPLACE;
} }
state.paint(g, creator.getBackupRectangle(), currentComp.getBounds(), new Rectangle(x, y, creator.initEditorSize().width, ((XCreator) currentComp).initEditorSize().height)); Rectangle currentCompRec = new Rectangle(currentComp.getX() - startX, currentComp.getY() - startY, currentComp.getWidth(), currentComp.getHeight());
state.paint(g, creator.getBackupRectangle(), currentCompRec, new Rectangle(x, y, creator.initEditorSize().width, ((XCreator) currentComp).initEditorSize().height));
} else { } else {
Color bColor = XCreatorConstants.LAYOUT_FORBIDDEN_COLOR; Color bColor = XCreatorConstants.LAYOUT_FORBIDDEN_COLOR;
int[] hot_rec = new int[]{x, y, 0, 0}; int[] hot_rec = new int[]{x, y, 0, 0};

6
designer-form/src/main/java/com/fr/design/designer/beans/painters/FROccupiedLayoutPainter.java

@ -40,11 +40,11 @@ public class FROccupiedLayoutPainter extends AbstractPainter {
Composite backupComposite = g2d.getComposite(); Composite backupComposite = g2d.getComposite();
g2d.setColor(XCreatorConstants.DRAG_IN_OCCUPIED_LAYOUT_COLOR); g2d.setColor(XCreatorConstants.DRAG_IN_OCCUPIED_LAYOUT_COLOR);
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.05f)); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.05f));
g2d.fillRect(container.getX(), container.getY(), container.getWidth(), container.getHeight()); g2d.fillRect(container.getX() - startX, container.getY() - startY, container.getWidth(), container.getHeight());
g2d.setStroke(XCreatorConstants.DASH_STROKE); g2d.setStroke(XCreatorConstants.DASH_STROKE);
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f)); g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f));
g2d.drawRect(container.getX() + 1, container.getY() + 1, container.getWidth() - 2, container.getHeight() - 2); g2d.drawRect(container.getX() - startX + 1, container.getY() - startY + 1, container.getWidth() - 2, container.getHeight() - 2);
g2d.setStroke(backupStroke); g2d.setStroke(backupStroke);
g2d.setComposite(backupComposite); g2d.setComposite(backupComposite);
g2d.setColor(backupColor); g2d.setColor(backupColor);
@ -53,4 +53,4 @@ public class FROccupiedLayoutPainter extends AbstractPainter {
} }
} }

Loading…
Cancel
Save