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

Add support for global <style>, as in Illustrator's SVG output (#12) #15

Merged
merged 1 commit into from
Jul 25, 2019

Conversation

edemaine
Copy link
Collaborator

This is actually pretty convenient using getComputedStyle, or jQuery's interface .css(). We just need to add the SVG to the document's DOM briefly (but remove it before the browser has a chance to render). I still kept the old lookup methods as fallbacks, in particular in case we're running outside of a browser in the future.

I also fixed the handling of simultaneous opacity and stroke-opacity. According to some experiments in Chrome and some random webpages, these get multiplied together if both occur.

@edemaine edemaine merged commit 4f9046c into master Jul 25, 2019
@edemaine
Copy link
Collaborator Author

Reading over "File Import Tips" for the nth time, I realize there was another way to use Illustrator -- I didn't realize I could tweak how styles were set in saved SVG files (quite handy!). But it's no longer needed for Origami Simulator (according to some limited testing), so I wonder whether we should delete that bullet and the two associated images?

image

@edemaine edemaine deleted the svg-style branch July 25, 2019 17:15
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

Successfully merging this pull request may close these issues.

1 participant