From 05be49ef24b84d3a2a921d61b7f70cb658da69ca Mon Sep 17 00:00:00 2001 From: Yegor Kozlov Date: Wed, 18 May 2011 10:07:15 +0000 Subject: [PATCH] fixed resizing pictures in XSSF, see Bugzilla 51160 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1124163 13f79535-47bb-0310-9956-ffa450edef68 --- src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java index 66a6d9c5a7..728a8dd93c 100644 --- a/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java +++ b/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFPicture.java @@ -239,7 +239,7 @@ public final class XSSFPicture extends XSSFShape implements Picture { int dy2 = 0; if(anchor.getDy1() > 0){ - h += getRowHeightInPixels(row2) - anchor.getDy1(); + h += getRowHeightInPixels(row2) - anchor.getDy1()/EMU_PER_PIXEL; row2++; } @@ -250,7 +250,7 @@ public final class XSSFPicture extends XSSFShape implements Picture { } if(h > scaledHeight) { - double ch = getRowHeightInPixels(row2 + 1); + double ch = getRowHeightInPixels(row2); double delta = h - scaledHeight; dy2 = (int)(EMU_PER_PIXEL*(ch-delta)); }