Author: nickarls
Date: 2008-10-03 16:05:13 -0400 (Fri, 03 Oct 2008)
New Revision: 9186
Modified:
trunk/src/excel/org/jboss/seam/excel/jxl/JXLExcelWorkbook.java
Log:
Fix ratio problem with images
Modified: trunk/src/excel/org/jboss/seam/excel/jxl/JXLExcelWorkbook.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/jxl/JXLExcelWorkbook.java 2008-10-03 19:57:11 UTC
(rev 9185)
+++ trunk/src/excel/org/jboss/seam/excel/jxl/JXLExcelWorkbook.java 2008-10-03 20:05:13 UTC
(rev 9186)
@@ -449,8 +449,10 @@
int useStartColumn = uiImage.getStartColumn() == null ? currentColumnIndex :
uiImage.getStartRow();
int useStartRow = uiImage.getStartRow() == null ? currentRowIndex :
uiImage.getStartRow();
- double useColumnSpan = uiImage.getColumnSpan() == null ? ((double)(image.getWidth()
/ CELL_DEFAULT_WIDTH)) : uiImage.getColumnSpan();
- double useRowSpan = uiImage.getRowSpan() == null ? ((double)(image.getWidth() /
CELL_DEFAULT_HEIGHT)) : uiImage.getRowSpan();
+ double estimatedRowSpan = (double)image.getHeight() / (double)CELL_DEFAULT_HEIGHT;
+ double estimatedColSpan = (double)image.getWidth() / (double)CELL_DEFAULT_WIDTH;
+ double useColumnSpan = uiImage.getColumnSpan() == null ? estimatedRowSpan :
uiImage.getColumnSpan();
+ double useRowSpan = uiImage.getRowSpan() == null ? estimatedColSpan :
uiImage.getRowSpan();
worksheet.addImage(new WritableImage(useStartColumn, useStartRow, useColumnSpan,
useRowSpan, pngStream.toByteArray()));
}
Show replies by date