diff --git a/designer-realize/src/main/java/com/fr/design/fit/grid/NewFormDesignerGridUI.java b/designer-realize/src/main/java/com/fr/design/fit/grid/NewFormDesignerGridUI.java index c3cc4f53df..9a2601aee2 100644 --- a/designer-realize/src/main/java/com/fr/design/fit/grid/NewFormDesignerGridUI.java +++ b/designer-realize/src/main/java/com/fr/design/fit/grid/NewFormDesignerGridUI.java @@ -2,6 +2,7 @@ package com.fr.design.fit.grid; import com.fr.design.designer.creator.XElementCase; import com.fr.design.fit.AdaptiveCellElementPainter; +import com.fr.design.fit.DesignerUIModeConfig; import com.fr.design.fit.common.FormDesignerUtil; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.FormDesigner; @@ -58,12 +59,22 @@ public class NewFormDesignerGridUI extends GridUI { return; } final Rectangle rectangle = getBoundsLineRect(elementCase, grid); - int width = rectangle.width - columnWidthList.getRangeValue(0, horizontalValue).toPixI(resolution); - int height = rectangle.height - rowHeightList.getRangeValue(0, verticalValue).toPixI(resolution); + int width = getScaleWidth(rectangle.width) - columnWidthList.getRangeValue(0, horizontalValue).toPixI(resolution); + int height = getScaleHeight(rectangle.height) - rowHeightList.getRangeValue(0, verticalValue).toPixI(resolution); drawBoundsLine(g2d, width, height); addListener(grid, elementCasePane, width, height, rectangle.width, rectangle.height); } + private int getScaleWidth(int width) { + return width * resolution / DesignerUIModeConfig.getInstance().getScreenResolution(); + + } + + private int getScaleHeight(int height) { + return height * resolution / DesignerUIModeConfig.getInstance().getScreenResolution(); + } + + /** * 获取需要画线的矩形大小 */ diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java index cf64757c2b..5c855aa3c4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/form/FormReportComponentComposite.java @@ -6,7 +6,7 @@ import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.cell.bar.DynamicScrollBar; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; -import com.fr.design.gui.ispinner.UIBasicSpinner; +import com.fr.design.fit.DesignerUIModeConfig; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.DesignerContext; @@ -74,7 +74,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo double value = jSliderContainer.getShowValue(); value = value > MAX ? MAX : value; value = value < MIN ? MIN : value; - int resolution = (int) (ScreenResolution.getScreenResolution() * value / HUND); + int resolution = (int) (DesignerUIModeConfig.getInstance().getScreenResolution() * value / HUND); setScale(resolution); // HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(resolution); } @@ -87,7 +87,7 @@ public class FormReportComponentComposite extends JComponent implements TargetMo private void setScale(int resolution) { ElementCasePane elementCasePane = elementCaseDesigner.getEditingElementCasePane(); //网格线 - if (resolution < ScreenResolution.getScreenResolution() * MIN_TIME) { + if (resolution < DesignerUIModeConfig.getInstance().getScreenResolution() * MIN_TIME) { elementCasePane.getGrid().setShowGridLine(false); } else { elementCasePane.getGrid().setShowGridLine(true);