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

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

@ -115,10 +115,11 @@ public class PolyUtils {
AddedData addedData = designer.getAddedData(); AddedData addedData = designer.getAddedData();
for (int count = addedData.getAddedCount() - 1; count >= 0; count--) { for (int count = addedData.getAddedCount() - 1; count >= 0; count--) {
BlockCreator creator = addedData.getAddedAt(count); BlockCreator creator = addedData.getAddedAt(count);
int cx = creator.getX(); float times = (float) designer.getResolution()/ScreenResolution.getScreenResolution();
int cy = creator.getY(); int cx = (int) (creator.getX() * times);
int cw = creator.getWidth(); int cy = (int) (creator.getY() * times);
int ch = creator.getHeight(); int cw = (int) (creator.getWidth() * times);
int ch = (int) (creator.getHeight() * times);
if (x >= cx && x <= (cx + cw)) { if (x >= cx && x <= (cx + cw)) {
if(y >= cy && y <= (cy + ch)) { if(y >= cy && y <= (cy + ch)) {
return creator; 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;
import com.fr.design.beans.location.MoveUtils.RectangleDesigner; import com.fr.design.beans.location.MoveUtils.RectangleDesigner;
import com.fr.design.beans.location.MoveUtils.RectangleIterator; import com.fr.design.beans.location.MoveUtils.RectangleIterator;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.poly.PolyDesigner; import com.fr.poly.PolyDesigner;
import com.fr.poly.PolyDesigner.SelectionType; import com.fr.poly.PolyDesigner.SelectionType;
@ -101,6 +102,7 @@ public class BottomCornerMouseHanlder extends MouseInputAdapter {
dragStart.y -= pressed.y; dragStart.y -= pressed.y;
TemplateBlock block = editor.getValue(); TemplateBlock block = editor.getValue();
resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution();
Rectangle bounds = block.getBounds().toRectangle(resolution); Rectangle bounds = block.getBounds().toRectangle(resolution);
Point resultPoint = MoveUtils.sorption(bounds.x + dragStart.x < 0 ? 0 : bounds.x + dragStart.x, bounds.y 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); + dragStart.y < 0 ? 0 : bounds.y + dragStart.y, bounds.width, bounds.height, rectDesigner, false);

Loading…
Cancel
Save