From: eschaeffer Date: Thu, 19 Oct 2000 11:18:35 +0000 (+0000) Subject: Correction for the text-align bug. X-Git-Tag: pre-columns~154 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e38a6f2e34663469bca1fd58a079e5c1d81e3e1e;p=xmlgraphics-fop.git 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 --- 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;