aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/fo/flow/ExternalGraphic.java
diff options
context:
space:
mode:
authorKeiron Liddle <keiron@apache.org>2002-07-05 09:21:48 +0000
committerKeiron Liddle <keiron@apache.org>2002-07-05 09:21:48 +0000
commit177b517adc5f990d4ca6abea0c64dc633d15b672 (patch)
treea6949d8829cc6c8922f9e5746826add942513fdb /src/org/apache/fop/fo/flow/ExternalGraphic.java
parent00e397fb0c50eb215aed37f03c7c9c427be318e8 (diff)
downloadxmlgraphics-fop-177b517adc5f990d4ca6abea0c64dc633d15b672.tar.gz
xmlgraphics-fop-177b517adc5f990d4ca6abea0c64dc633d15b672.zip
alignment and scaling for instream-foreign-object using viewport
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194971 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo/flow/ExternalGraphic.java')
-rw-r--r--src/org/apache/fop/fo/flow/ExternalGraphic.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/org/apache/fop/fo/flow/ExternalGraphic.java b/src/org/apache/fop/fo/flow/ExternalGraphic.java
index 37f896677..614c6953d 100644
--- a/src/org/apache/fop/fo/flow/ExternalGraphic.java
+++ b/src/org/apache/fop/fo/flow/ExternalGraphic.java
@@ -146,7 +146,7 @@ public class ExternalGraphic extends FObj {
// adjust the larger
double rat1 = cwidth / (fopimage.getWidth() * 1000f);
double rat2 = cheight / (fopimage.getHeight() * 1000f);
- if(rat1 > rat2) {
+ if(rat1 < rat2) {
// reduce cheight
cheight = (int)(rat1 * fopimage.getHeight() * 1000);
} else {
@@ -162,13 +162,14 @@ public class ExternalGraphic extends FObj {
viewHeight = cheight;
}
- int overflow = properties.get("overflow").getEnum();
- if(overflow == Overflow.HIDDEN) {
- clip = true;
- }
- if(overflow == Overflow.ERROR_IF_OVERFLOW && (cwidth > viewWidth || cheight > viewHeight)) {
- log.error("Image: " + url + " overflows the viewport");
- clip = true;
+ if(cwidth > viewWidth || cheight > viewHeight) {
+ int overflow = properties.get("overflow").getEnum();
+ if(overflow == Overflow.HIDDEN) {
+ clip = true;
+ } else if(overflow == Overflow.ERROR_IF_OVERFLOW) {
+ log.error("Image: " + url + " overflows the viewport");
+ clip = true;
+ }
}
int xoffset = 0;