Author: gadams
Date: Tue Nov 11 07:43:36 2014
New Revision: 1638043

URL: http://svn.apache.org/r1638043
Log:
Fix defaulting of background color, mode.

Modified:
    
xmlgraphics/batik/branches/text-background/sources/org/apache/batik/bridge/SVGTextElementBridge.java

Modified: 
xmlgraphics/batik/branches/text-background/sources/org/apache/batik/bridge/SVGTextElementBridge.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/batik/branches/text-background/sources/org/apache/batik/bridge/SVGTextElementBridge.java?rev=1638043&r1=1638042&r2=1638043&view=diff
==============================================================================
--- 
xmlgraphics/batik/branches/text-background/sources/org/apache/batik/bridge/SVGTextElementBridge.java
 (original)
+++ 
xmlgraphics/batik/branches/text-background/sources/org/apache/batik/bridge/SVGTextElementBridge.java
 Tue Nov 11 07:43:36 2014
@@ -101,8 +101,6 @@ import org.w3c.dom.svg.SVGTextPositionin
 public class SVGTextElementBridge extends AbstractGraphicsNodeBridge
     implements SVGTextContent {
 
-    public static final Color TRANSPARENT = new Color(0, 0, 0, 0);
-
     protected static final Integer ZERO = new Integer(0);
 
     public static final
@@ -1970,10 +1968,10 @@ public class SVGTextElementBridge extend
         pi.visible      = CSSUtilities.convertVisibility(element);
         StyleMap sm = ((CSSStylableElement)element).getComputedStyleMap(null);
         Paint backgroundPaint = PaintServer.convertBackgroundPaint(element, 
node, ctx);
-        if (!sm.isNullCascaded(SVGCSSEngine.BACKGROUND_COLOR_INDEX))
+        if ((pi.backgroundPaint == null) || 
!sm.isNullCascaded(SVGCSSEngine.BACKGROUND_COLOR_INDEX))
             pi.backgroundPaint = backgroundPaint;
         BackgroundMode backgroundMode = 
TextUtilities.convertBackgroundMode(element);
-        if (!sm.isNullCascaded(SVGCSSEngine.BACKGROUND_MODE_INDEX))
+        if ((pi.backgroundMode == null) || 
!sm.isNullCascaded(SVGCSSEngine.BACKGROUND_MODE_INDEX))
             pi.backgroundMode = backgroundMode;
         pi.fillPaint    = PaintServer.convertFillPaint  (element, node, ctx);
         pi.strokePaint  = PaintServer.convertStrokePaint(element, node, ctx);


Reply via email to