Hi all,

the currrent Transcoder doesn't recognize changes of the dimension on
the SVG-Root element by a script (invoked by -onload). Changes on other
elements are generated fine. This problem was described by other user on
the user-list [1].

The patch is quite simple, it invoke the script before the dimension
(height and width) are read from the document. 
The current implementation invokes the script after the dimension are
set to the result image.

Best Regrads,
Simon




[1]
http://mail-archives.apache.org/eyebrowse/[EMAIL PROTECTED]&msgNo=3482
Index: SVGAbstractTranscoder.java
===================================================================
RCS file: 
/home/cvspublic/xml-batik/sources/org/apache/batik/transcoder/SVGAbstractTranscoder.java,v
retrieving revision 1.20
diff -u -r1.20 SVGAbstractTranscoder.java
--- SVGAbstractTranscoder.java  18 Aug 2004 07:15:41 -0000      1.20
+++ SVGAbstractTranscoder.java  4 Nov 2004 20:22:08 -0000
@@ -207,6 +207,22 @@
         } catch (BridgeException ex) {
             throw new TranscoderException(ex);
         }
+       
+       
+       if(isDynamic){
+            try {
+               // dispatch an 'onload' event if needed
+                BaseScriptingEnvironment se;
+                se = new BaseScriptingEnvironment(ctx);
+                se.loadScripts();
+                se.dispatchSVGLoadEvent();
+           
+            } catch (BridgeException ex) {
+                    throw new TranscoderException(ex);
+            }
+        }
+       
+       
         // get the 'width' and 'height' attributes of the SVG document
         float docWidth = (float)ctx.getDocumentSize().getWidth();
         float docHeight = (float)ctx.getDocumentSize().getHeight();
@@ -260,18 +276,6 @@
             curTxf = new AffineTransform();
         } else {
             curTxf = Px;
-        }
-
-        try {
-            // dispatch an 'onload' event if needed
-            if (ctx.isDynamic()) {
-                BaseScriptingEnvironment se;
-                se = new BaseScriptingEnvironment(ctx);
-                se.loadScripts();
-                se.dispatchSVGLoadEvent();
-            }
-        } catch (BridgeException ex) {
-            throw new TranscoderException(ex);
         }
 
         this.root = gvtRoot;

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to