aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/image
diff options
context:
space:
mode:
authoreschaeffer <eschaeffer@unknown>2000-10-19 11:18:35 +0000
committereschaeffer <eschaeffer@unknown>2000-10-19 11:18:35 +0000
commite38a6f2e34663469bca1fd58a079e5c1d81e3e1e (patch)
tree259d76162ab628e81ac1a53b6877a627a8dc1110 /src/org/apache/fop/image
parent9d7878bde5de874a9987b52af99b5f8d9f684f51 (diff)
downloadxmlgraphics-fop-e38a6f2e34663469bca1fd58a079e5c1d81e3e1e.tar.gz
xmlgraphics-fop-e38a6f2e34663469bca1fd58a079e5c1d81e3e1e.zip
Correction for the text-align bug.
PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193729 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/image')
-rw-r--r--src/org/apache/fop/image/ImageArea.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/org/apache/fop/image/ImageArea.java b/src/org/apache/fop/image/ImageArea.java
index 8442723c7..65c512861 100644
--- a/src/org/apache/fop/image/ImageArea.java
+++ b/src/org/apache/fop/image/ImageArea.java
@@ -52,6 +52,7 @@
package org.apache.fop.image;
+import org.apache.fop.fo.properties.TextAlign;
import org.apache.fop.layout.*;
import org.apache.fop.render.Renderer;
@@ -72,16 +73,18 @@ public class ImageArea extends Area {
this.image = img;
switch (align) {
- case 1: // should be TextAlign.START
+ case TextAlign.START:
xOffset = startIndent;
break;
- case 2: //should be TextAlign.END
+ case TextAlign.END:
if (endIndent == 0)
endIndent = AllocationWidth;
xOffset = (endIndent - width);
break;
- case 3: //should be TextAlign.CENTER
- case 4: //should be TextAlign.JUSTIFY
+ case TextAlign.JUSTIFY:
+ xOffset = startIndent;
+ break;
+ case TextAlign.CENTER:
if (endIndent == 0)
endIndent = AllocationWidth;
xOffset = startIndent + ((endIndent - startIndent) - width)/2;