deweese 2003/07/21 17:49:58 Modified: sources/org/apache/batik/bridge SVGTextElementBridge.java sources/org/apache/batik/gvt/renderer StrokingTextPainter.java Log: 1) The glyphs of initially hidden text no longer stay hidden when the text becomes visible. Revision Changes Path 1.83 +42 -33 xml-batik/sources/org/apache/batik/bridge/SVGTextElementBridge.java Index: SVGTextElementBridge.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGTextElementBridge.java,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- SVGTextElementBridge.java 3 Jul 2003 14:10:01 -0000 1.82 +++ SVGTextElementBridge.java 22 Jul 2003 00:49:57 -0000 1.83 @@ -570,38 +570,14 @@ case SVGCSSEngine.STROKE_MITERLIMIT_INDEX: case SVGCSSEngine.STROKE_DASHARRAY_INDEX: case SVGCSSEngine.STROKE_DASHOFFSET_INDEX: - case SVGCSSEngine.TEXT_DECORATION_INDEX: { - if (!hasNewACI) { - hasNewACI = true; - TextNode tn = (TextNode)node; - AttributedString as; - - TextDecoration parentDecoration; - - if ( cssProceedElement == e ){ - parentDecoration = new TextDecoration(); - as = new AttributedString(layoutedText.getIterator()); - } - else{ - //if a child CSS property has changed, then - //retrieve the parent text decoration - //and only update the section of the AtrtibutedString of - //the child - parentDecoration = getParentTextDecoration - (tn.getAttributedCharacterIterator(), - cssProceedElement); - as = new AttributedString - (tn.getAttributedCharacterIterator()); - } - tn.setAttributedCharacterIterator(as.getIterator()); - TextDecoration textDecoration = getTextDecoration - (cssProceedElement, tn, parentDecoration, ctx); - addPaintAttributes - (as, cssProceedElement, tn, textDecoration, ctx); - tn.setAttributedCharacterIterator(as.getIterator()); - } + case SVGCSSEngine.TEXT_DECORATION_INDEX: + rebuildACI(); + break; + + case SVGCSSEngine.VISIBILITY_INDEX: + rebuildACI(); + super.handleCSSPropertyChanged(property); break; - } case SVGCSSEngine.TEXT_RENDERING_INDEX: { RenderingHints hints = node.getRenderingHints(); hints = CSSUtilities.convertTextRendering(e, hints); @@ -623,6 +599,39 @@ } } + protected void rebuildACI() { + if (hasNewACI) + return; + + hasNewACI = true; + TextNode tn = (TextNode)node; + AttributedString as; + + TextDecoration parentDecoration; + + if ( cssProceedElement == e ){ + parentDecoration = new TextDecoration(); + as = new AttributedString(layoutedText.getIterator()); + } + else{ + //if a child CSS property has changed, then + //retrieve the parent text decoration + //and only update the section of the AtrtibutedString of + //the child + parentDecoration = getParentTextDecoration + (tn.getAttributedCharacterIterator(), + cssProceedElement); + as = new AttributedString + (tn.getAttributedCharacterIterator()); + } + tn.setAttributedCharacterIterator(as.getIterator()); + TextDecoration textDecoration = getTextDecoration + (cssProceedElement, tn, parentDecoration, ctx); + addPaintAttributes + (as, cssProceedElement, tn, textDecoration, ctx); + tn.setAttributedCharacterIterator(as.getIterator()); + } + // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -1206,7 +1215,7 @@ // Fill Paint p = PaintServer.convertFillPaint(element, node, ctx); - // System.out.println("Fore: " + p + " [" + firstChar + "," + + // System.err.println("Fore: " + p + " [" + firstChar + "," + // (lastChar+1) + "]"); as.addAttribute(TextAttribute.FOREGROUND, p, firstChar, lastChar+1); 1.46 +1 -2 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.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- StrokingTextPainter.java 9 Jul 2003 02:10:10 -0000 1.45 +++ StrokingTextPainter.java 22 Jul 2003 00:49:57 -0000 1.46 @@ -1000,7 +1000,6 @@ */ private void paintTextRuns(List textRuns, Graphics2D g2d) { - for (int i = 0; i < textRuns.size(); i++) { TextRun textRun = (TextRun)textRuns.get(i); AttributedCharacterIterator runaci = textRun.getACI();
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]