From 1b036b2f959015c541f50d769586c4619bd2e008 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 18 Mar 2021 15:58:29 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-48866=E3=80=90FR-X=E3=80=91=E4=BB=BB?= =?UTF-8?q?=E6=84=8F=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=8A=A5=E8=A1=A8=E5=9D=97=EF=BC=8C=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E6=8A=A5=E8=A1=A8=E5=9D=97=EF=BC=8C=E6=94=BE?= =?UTF-8?q?=E5=A4=A7=E7=BC=A9=E5=B0=8F=E8=AE=BE=E8=AE=A1=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=88ctrl+=E9=BC=A0=E6=A0=87=E6=BB=9A=E8=BD=AE=E7=AD=89?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=EF=BC=89=EF=BC=8C=E6=8A=A5=E8=A1=A8=E5=9D=97?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=94=BE=E5=A4=A7=E7=BC=A9=E5=B0=8F=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E8=99=9A=E7=BA=BF=E6=B2=A1=E6=9C=89=E8=B7=9F?= =?UTF-8?q?=E9=9A=8F=E5=8F=98=E5=8C=96=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/fit/grid/NewFormDesignerGridUI.java | 15 +++++++++++++-- .../form/FormReportComponentComposite.java | 6 +++--- 2 files changed, 16 insertions(+), 5 deletions(-) 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);