From batik-dev-return-4322-apmail-xml-batik-dev-archive=xml.apache.org@xml.apache.org Sat Jun 07 17:19:20 2003 Return-Path: Delivered-To: apmail-xml-batik-dev-archive@xml.apache.org Received: (qmail 70484 invoked by uid 500); 7 Jun 2003 17:19:19 -0000 Mailing-List: contact batik-dev-help@xml.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: batik-dev@xml.apache.org Delivered-To: mailing list batik-dev@xml.apache.org Received: (qmail 70473 invoked by uid 500); 7 Jun 2003 17:19:19 -0000 Delivered-To: apmail-xml-batik-cvs@apache.org Date: 7 Jun 2003 17:19:18 -0000 Message-ID: <20030607171918.86434.qmail@icarus.apache.org> From: deweese@apache.org To: xml-batik-cvs@apache.org Subject: cvs commit: xml-batik/test-resources/org/apache/batik/test samplesRendering.xml X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N deweese 2003/06/07 10:19:18 Modified: sources/org/apache/batik/bridge SVGImageElementBridge.java SVGSVGElementBridge.java test-resources/org/apache/batik/test samplesRendering.xml Added: samples/tests/spec/scripting viewBoxOnLoad.svg Log: 1) Fixed bug setting viewBox on outermost SVG element as described in: http://koala.ilog.fr/batik/mlists/batik-users/archives/msg03513.html Also added test for setting inner/outer svg viewbox onload. 2) Added several files to regard's 'samples' tests. Revision Changes Path 1.1 xml-batik/samples/tests/spec/scripting/viewBoxOnLoad.svg Index: viewBoxOnLoad.svg =================================================================== 'viewBox' modification in 'onload' viewBox modification in 'onload' No red should show 1.54 +8 -2 xml-batik/sources/org/apache/batik/bridge/SVGImageElementBridge.java Index: SVGImageElementBridge.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGImageElementBridge.java,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- SVGImageElementBridge.java 11 Apr 2003 13:54:49 -0000 1.53 +++ SVGImageElementBridge.java 7 Jun 2003 17:19:18 -0000 1.54 @@ -24,6 +24,7 @@ import org.apache.batik.ext.awt.image.renderable.ClipRable8Bit; import org.apache.batik.ext.awt.image.renderable.Filter; import org.apache.batik.ext.awt.image.spi.ImageTagRegistry; +import org.apache.batik.gvt.CanvasGraphicsNode; import org.apache.batik.gvt.CompositeGraphicsNode; import org.apache.batik.gvt.GraphicsNode; import org.apache.batik.gvt.ImageNode; @@ -367,13 +368,18 @@ } SVGSVGElement svgElement = imgDocument.getRootElement(); - GraphicsNode node = ctx.getGVTBuilder().build(ctx, svgElement); + CanvasGraphicsNode node; + node = (CanvasGraphicsNode)ctx.getGVTBuilder().build(ctx, svgElement); ctx.addUIEventListeners(imgDocument); // HACK: remove the clip set by the SVGSVGElement as the overflow // and clip properties must be ignored. The clip will be set later // using the overflow and clip of the element. node.setClip(null); + // HACK: remove the viewingTransform set by the SVGSVGElement + // as the viewBox must be ignored. The viewingTransform will + // be set later using the width/height of the image element. + node.setViewingTransform(new AffineTransform()); result.getChildren().add(node); // create the implicit viewBox for the SVG image. The viewBox for a 1.34 +6 -3 xml-batik/sources/org/apache/batik/bridge/SVGSVGElementBridge.java Index: SVGSVGElementBridge.java =================================================================== RCS file: /home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGSVGElementBridge.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- SVGSVGElementBridge.java 11 Apr 2003 13:54:52 -0000 1.33 +++ SVGSVGElementBridge.java 7 Jun 2003 17:19:18 -0000 1.34 @@ -74,7 +74,7 @@ // have a parent SVG element, this check makes sure only the // real root of the SVG Document tries to do negotiation with // the UA. - SVGDocument doc = (SVGDocument)((SVGElement)e).getOwnerDocument(); + SVGDocument doc = (SVGDocument)e.getOwnerDocument(); boolean isOutermost = (doc.getRootElement() == e); float x = 0; float y = 0; @@ -132,14 +132,17 @@ // agent, so we don't need to set the transform for outermost svg Shape clip = null; if (!isOutermost) { + // X & Y are ignored on outermost SVG. cgn.setPositionTransform(positionTransform); - cgn.setViewingTransform(viewingTransform); } else { // FIXME: hack to compute the original document's size if (ctx.getDocumentSize() == null) { ctx.setDocumentSize(new Dimension((int)w, (int)h)); } } + // Set the viewing transform, this is often updated when the + // component prepares for rendering. + cgn.setViewingTransform(viewingTransform); if (CSSUtilities.convertOverflow(e)) { // overflow:hidden float [] offsets = CSSUtilities.convertClip(e); 1.96 +9 -1 xml-batik/test-resources/org/apache/batik/test/samplesRendering.xml Index: samplesRendering.xml =================================================================== RCS file: /home/cvs/xml-batik/test-resources/org/apache/batik/test/samplesRendering.xml,v retrieving revision 1.95 retrieving revision 1.96 diff -u -r1.95 -r1.96 --- samplesRendering.xml 24 Mar 2003 10:07:01 -0000 1.95 +++ samplesRendering.xml 7 Jun 2003 17:19:18 -0000 1.96 @@ -39,6 +39,7 @@ + @@ -77,6 +78,12 @@ + + + + + + @@ -364,6 +371,7 @@ + --------------------------------------------------------------------- To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org For additional commands, e-mail: batik-dev-help@xml.apache.org