Browse Source

REPORT-27728 单元格设置背景色会遮挡原始边框

feature/big-screen
Hugh.C 5 years ago
parent
commit
2728eca125
  1. 2
      designer-realize/src/main/java/com/fr/grid/CellElementPainter.java
  2. 8
      designer-realize/src/main/java/com/fr/grid/GridUI.java

2
designer-realize/src/main/java/com/fr/grid/CellElementPainter.java

@ -9,7 +9,7 @@ import com.fr.report.core.PaintUtils;
import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.ElementCase;
public class CellElementPainter { public class CellElementPainter {
public void paintBackground(Graphics2D g2d, ElementCase report, CellElement ce, int width, int height) { public void paintBackground(Graphics2D g2d, ElementCase report, CellElement ce, double width, double height) {
Style.paintBackground(g2d, ce.getStyle(), width, height); Style.paintBackground(g2d, ce.getStyle(), width, height);
} }

8
designer-realize/src/main/java/com/fr/grid/GridUI.java

@ -497,12 +497,12 @@ public class GridUI extends ComponentUI {
paintCellElementRectangleList.add(this.tmpRectangle.clone()); paintCellElementRectangleList.add(this.tmpRectangle.clone());
int cellWidth = (int) this.tmpRectangle.getWidth(); double cellWidth = this.tmpRectangle.getWidth();
int cellHeight = (int) this.tmpRectangle.getHeight(); double cellHeight = this.tmpRectangle.getHeight();
// denny_Grid: 画Grid中单元格的内容(包括单元格的背景Content + Background), 不包括边框 // denny_Grid: 画Grid中单元格的内容(包括单元格的背景Content + Background), 不包括边框
painter.paintBackground(g2d, report, tmpCellElement, cellWidth, cellHeight); painter.paintBackground(g2d, report, tmpCellElement, cellWidth - 1, cellHeight - 1);
painter.paintContent(g2d, report, tmpCellElement, cellWidth, cellHeight, resolution); painter.paintContent(g2d, report, tmpCellElement, (int) cellWidth, (int) cellHeight, resolution);
// denny_Grid: 注意下面还要减一, 因为上面translate时加一 // denny_Grid: 注意下面还要减一, 因为上面translate时加一
g2d.translate(-this.tmpRectangle.getX() - 1, -this.tmpRectangle.getY() - 1); g2d.translate(-this.tmpRectangle.getX() - 1, -this.tmpRectangle.getY() - 1);
paintAuthorityCell(g2d, tmpCellElement); paintAuthorityCell(g2d, tmpCellElement);

Loading…
Cancel
Save