You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by de...@apache.org on 2004/02/14 22:22:40 UTC
cvs commit: xml-batik/sources/org/apache/batik/bridge SVGClipPathElementBridge.java
deweese 2004/02/14 13:22:40
Modified: sources/org/apache/batik/bridge
SVGClipPathElementBridge.java
Log:
Patch for bug in ClipPath and clip-rule with 'use' element.
Submitted by: Cameron McCormack
Revision Changes Path
1.20 +18 -1 xml-batik/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java
Index: SVGClipPathElementBridge.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGClipPathElementBridge.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- SVGClipPathElementBridge.java 9 Aug 2003 16:58:37 -0000 1.19
+++ SVGClipPathElementBridge.java 14 Feb 2004 21:22:40 -0000 1.20
@@ -55,6 +55,8 @@
import java.awt.geom.Area;
import java.awt.geom.GeneralPath;
+import org.apache.batik.css.engine.CSSImportNode;
+import org.apache.batik.dom.svg.SVGOMCSSImportedElementRoot;
import org.apache.batik.ext.awt.image.renderable.ClipRable;
import org.apache.batik.ext.awt.image.renderable.ClipRable8Bit;
import org.apache.batik.ext.awt.image.renderable.Filter;
@@ -151,6 +153,21 @@
continue;
}
hasChildren = true;
+
+ // if this is a 'use' element, get the actual shape used
+ if (child instanceof CSSImportNode) {
+ SVGOMCSSImportedElementRoot shadow =
+ (SVGOMCSSImportedElementRoot)
+ ((CSSImportNode) child).getCSSImportedElementRoot();
+
+ if (shadow != null) {
+ Node shadowChild = shadow.getFirstChild();
+ if (shadowChild != null
+ && shadowChild.getNodeType() == Node.ELEMENT_NODE) {
+ child = (Element) shadowChild;
+ }
+ }
+ }
// compute the outline of the current clipPath's child
int wr = CSSUtilities.convertClipRule(child);
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org