]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Correction for the text-align bug.
authoreschaeffer <eschaeffer@unknown>
Thu, 19 Oct 2000 11:18:35 +0000 (11:18 +0000)
committereschaeffer <eschaeffer@unknown>
Thu, 19 Oct 2000 11:18:35 +0000 (11:18 +0000)
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

src/org/apache/fop/image/ImageArea.java

index 8442723c7f049bd419f44d54aa7b586d374b9eb1..65c512861fd241a986bae04e81a6d7fec1c624d6 100644 (file)
@@ -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;