Browse Source

REPORT-4450 聚合报表在缩放后编辑报表块,会出现单元格错乱

master
momeak 7 years ago
parent
commit
e35913ef16
  1. 3
      designer/src/com/fr/poly/PolyDesigner.java
  2. 9
      designer/src/com/fr/poly/PolyUtils.java
  3. 2
      designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java

3
designer/src/com/fr/poly/PolyDesigner.java

@ -272,7 +272,6 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
this.time = (float) resolution / ScreenResolution.getScreenResolution();
resetEditorComponentBounds();
LayoutUtils.layoutRootContainer(this);
g.setColor(Color.black);
GraphHelper.drawLine(g, 0, 0, this.getWidth(), 0);
GraphHelper.drawLine(g, 0, 0, 0, this.getHeight());
@ -281,7 +280,7 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
private void resetEditorComponentBounds() {
if (selection != null) {
selection.setResolution(this.resolution);
selection.setResolution(ScreenResolution.getScreenResolution());
selection.getEditor().setBounds((int) (selection.getEditorBounds().x * time), (int) (selection.getEditorBounds().y * time),
(int) (selection.getEditorBounds().width * time), (int) (selection.getEditorBounds().height * time));
LayoutUtils.layoutRootContainer(this);

9
designer/src/com/fr/poly/PolyUtils.java

@ -115,10 +115,11 @@ public class PolyUtils {
AddedData addedData = designer.getAddedData();
for (int count = addedData.getAddedCount() - 1; count >= 0; count--) {
BlockCreator creator = addedData.getAddedAt(count);
int cx = creator.getX();
int cy = creator.getY();
int cw = creator.getWidth();
int ch = creator.getHeight();
float times = (float) designer.getResolution()/ScreenResolution.getScreenResolution();
int cx = (int) (creator.getX() * times);
int cy = (int) (creator.getY() * times);
int cw = (int) (creator.getWidth() * times);
int ch = (int) (creator.getHeight() * times);
if (x >= cx && x <= (cx + cw)) {
if(y >= cy && y <= (cy + ch)) {
return creator;

2
designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java

@ -15,6 +15,7 @@ import com.fr.design.beans.location.Absorptionline;
import com.fr.design.beans.location.MoveUtils;
import com.fr.design.beans.location.MoveUtils.RectangleDesigner;
import com.fr.design.beans.location.MoveUtils.RectangleIterator;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.general.ComparatorUtils;
import com.fr.poly.PolyDesigner;
import com.fr.poly.PolyDesigner.SelectionType;
@ -101,6 +102,7 @@ public class BottomCornerMouseHanlder extends MouseInputAdapter {
dragStart.y -= pressed.y;
TemplateBlock block = editor.getValue();
resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution();
Rectangle bounds = block.getBounds().toRectangle(resolution);
Point resultPoint = MoveUtils.sorption(bounds.x + dragStart.x < 0 ? 0 : bounds.x + dragStart.x, bounds.y
+ dragStart.y < 0 ? 0 : bounds.y + dragStart.y, bounds.width, bounds.height, rectDesigner, false);

Loading…
Cancel
Save