bella 01/07/30 18:07:34
Modified: sources/org/apache/batik/gvt/renderer
StrokingTextPainter.java
Log:
fixed up bug with writing-mode=rl
Revision Changes Path
1.9 +12 -1
xml-batik/sources/org/apache/batik/gvt/renderer/StrokingTextPainter.java
Index: StrokingTextPainter.java
===================================================================
RCS file:
/home/cvs/xml-batik/sources/org/apache/batik/gvt/renderer/StrokingTextPainter.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- StrokingTextPainter.java 2001/07/05 06:37:46 1.8
+++ StrokingTextPainter.java 2001/07/31 01:07:34 1.9
@@ -52,7 +52,7 @@
* @see org.apache.batik.gvt.text.GVTAttributedCharacterIterator
*
* @author <a href="[EMAIL PROTECTED]>Bill Haneman</a>
- * @version $Id: StrokingTextPainter.java,v 1.8 2001/07/05 06:37:46 bella Exp $
+ * @version $Id: StrokingTextPainter.java,v 1.9 2001/07/31 01:07:34 bella Exp $
*/
public class StrokingTextPainter extends BasicTextPainter {
@@ -1263,6 +1263,17 @@
anchorType = TextNode.Anchor.ANCHOR_START;
if (anchor != null) {
anchorType = anchor.getType();
+ }
+ // if writing mode is right to left, then need to reverse the
+ // text anchor positions
+ if
(aci.getAttribute(GVTAttributedCharacterIterator.TextAttribute.WRITING_MODE)
+ == GVTAttributedCharacterIterator.TextAttribute.WRITING_MODE_RTL) {
+ if (anchorType == TextNode.Anchor.ANCHOR_START) {
+ anchorType = TextNode.Anchor.ANCHOR_END;
+ } else if (anchorType == TextNode.Anchor.ANCHOR_END) {
+ anchorType = TextNode.Anchor.ANCHOR_START;
+ }
+ // leave middle as is
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]