Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding and removing style declarations doesn't change render #53

Open
markviewbix opened this issue Jun 2, 2016 · 2 comments
Open

Adding and removing style declarations doesn't change render #53

markviewbix opened this issue Jun 2, 2016 · 2 comments

Comments

@markviewbix
Copy link

Hi,

I have an SVGDocument which I created by the load() function. Once the document has been rendered, I want to change some of the colors of the svg. I do this by calling removeStyleDeclaration and addStyleDeclaration for the style I want to change with a new style created by createdFromString.

The problem is that this doesn't change the colors of the render. Is there something else I need to do?

Thanks,

Mark

@lucaslorentz
Copy link
Owner

Hey,

That's a bug, changes to declaration should invalidate all styles.

You can invalidate all styles by yourself calling:

document.invalidateStyle(true); //parameter is if the invalidation should be recursive, invalidating all nested elements

That method is here:
https://github.com/LucasLorentz/AS3SVGRenderer/blob/master/SVGRenderer/src/com/lorentz/SVG/display/base/SVGElement.as#L329

Cheers,

Lucas Lorentz

@markviewbix
Copy link
Author

Thanks! I figured that out after I posted the issue. I'm glad the solution
I hit on was the correct one.

On Fri, Jun 3, 2016, 4:46 AM Lucas Lorentz [email protected] wrote:

Hey,

That's a bug, changes to declaration should invalidate all styles.

You can invalidate all styles by yourself calling:

document.invalidateStyle(true); //parameter is if the invalidation should be recursive, invalidating all nested elements

That method is here:

https://github.com/LucasLorentz/AS3SVGRenderer/blob/master/SVGRenderer/src/com/lorentz/SVG/display/base/SVGElement.as#L329

Cheers,

Lucas Lorentz


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#53 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AJ4MwqF6JNTeHbJ34Qgvdu0nZoVle_bCks5qH4eMgaJpZM4IsTQ0
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants