Hi Bader,
bader houmad wrote:
I didn't really understand what you mean by 'twiddle' the fill, or how
to do it. What I tried to do is to call the method
"setSVGDocument(ChangedDoc)" after each change of the gradient, but this
causes a lot of fluttering in the animation.
This is very expensive (and I would suspect should break
any scripting...). For what I am suggesting to work you
need to know ahead of time what elements are using the gradient
fill you are modifying. Then you can get just those elements
and do something 'silly' like:
Element e = root.getElementById("usesGradient");
String s = e.getStyle().getProperty("fill");
e.getStyle().setProperty("fill", "black", "");
e.getStyle().setProperty("fill", s, "");
Is there another method to notice the change of the gradient?
Well you can register DOM mutation event listeners, the tricky
bit is knowing when to remove them (at one point Batik did track
gradient changes but it leaked memory so badly that the feature
was removed).
Thanks
Best Regards
Bader
From: Thomas DeWeese <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: problem when changing an attribute
Date: Mon, 22 Aug 2005 12:46:46 -0400
bader houmad wrote:
I precise that I set the document stae to dynamic:
JSVGCanvas.setDocumentState(JSVGCanvas.ALWAYS_DYNAMIC).
and I call the method "setAttribueNS" in the UpdateManager's thread.
Batik doesn't properly track dependencies on Gradients. So
you will need to 'twiddle' the fill on the element referencing
the Gradient for Batik to 'notice' that the gradient has changed.
Sorry.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Ne cherchez plus, trouvez ! Avec le nouveau MSN Search.
http://search.msn.fr/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]