Skip to content

Commit

Permalink
修正类型转换错误
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Aug 20, 2024
1 parent 4206129 commit 56f5740
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,14 @@ public double getHeight() {
return height;
}

public float getFloatHeight(){
return (float) getHeight();
}

public float getFloatWidth(){
return (float) getWidth();
}


public static ExcelPaperSize of(int paperSize) {
if (paperSize < 0 || paperSize >= values().length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public static Rectangle getPageSize(ExcelPaperSize paperSize, boolean horizontal
paperSize = ExcelPaperSize.A4_PAPER;

if (horizontal) {
Rectangle rect = new Rectangle(paperSize.getHeight(), paperSize.getWidth());
Rectangle rect = new Rectangle(paperSize.getFloatHeight(), paperSize.getFloatWidth());
rect.rotate();
return rect;
} else {
Rectangle rect = new Rectangle(paperSize.getWidth(), paperSize.getHeight());
Rectangle rect = new Rectangle(paperSize.getFloatWidth(), paperSize.getFloatHeight());
return rect;
}
}
Expand Down

0 comments on commit 56f5740

Please sign in to comment.