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

Added additional settings that seem useful for SVG on the web. #4

Closed
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@sladkoff

sladkoff commented Jul 7, 2016

Hi.

I'm generating SVG for the web and need the SVG to be responsive.
I did some research along the way and found that certain properties can be set on the root element in order to make the SVG scale nicely in browsers.

The properties in question are:

I added settings for these two in the SVGGraphics2D class accordingly.

I also found that even when the viewBox property is set, an explicit width and height on the SVG can influence responsiveness on the web as described here, for example.

For this reason I added a printDimensions flag which is true by default but can be disabled so that no dimensions are added to the SVG root element.

Hope these additions are desirable.

Things are documented and basic parameter checks are in place.

Cheers.

@jfree

This comment has been minimized.

Show comment
Hide comment
@jfree

jfree Jul 18, 2016

Owner

Hi, The changes you are proposing look very useful. There's one issue though, JFreeSVG is dual-licensed so in order to incorporate your code I would need you to agree to assign the copyright for your changes to my company Object Refinery Limited. Is that acceptable for you?

Thanks for the link to the website explaining the viewBox settings, that's very useful.

Owner

jfree commented Jul 18, 2016

Hi, The changes you are proposing look very useful. There's one issue though, JFreeSVG is dual-licensed so in order to incorporate your code I would need you to agree to assign the copyright for your changes to my company Object Refinery Limited. Is that acceptable for you?

Thanks for the link to the website explaining the viewBox settings, that's very useful.

@sladkoff

This comment has been minimized.

Show comment
Hide comment
@sladkoff

sladkoff Jul 23, 2016

Sure, I'm fine with that.
^ Does this suffice as agreement or does it need to be more official :)

sladkoff commented Jul 23, 2016

Sure, I'm fine with that.
^ Does this suffice as agreement or does it need to be more official :)

@jfree

This comment has been minimized.

Show comment
Hide comment
@jfree

jfree Aug 30, 2016

Owner

I've just committed some changes that should give the same results but with a slightly different approach. If you have time to look over it, let me know if the way I've done it meets your requirements. I could tweak it before the official 3.2 release.

Owner

jfree commented Aug 30, 2016

I've just committed some changes that should give the same results but with a slightly different approach. If you have time to look over it, let me know if the way I've done it meets your requirements. I could tweak it before the official 3.2 release.

@sladkoff

This comment has been minimized.

Show comment
Hide comment
@sladkoff

sladkoff Sep 14, 2016

Sorry for the delay. I only now got the chance to test.

I found one issue. When you set a value for meetOrSlice, exemplary SVG output looks like this: preserveAspectRatio="xMidYMid" meetorslice="slice"

meetOrSlice is actually a parameter of the preserveAspectRatio attribute and thus the output should be: preserveAspectRatio="xMidYMid slice"

Other than that it meets my requirements quite well and the enum approach is cleaner than my quick hack :)

sladkoff commented Sep 14, 2016

Sorry for the delay. I only now got the chance to test.

I found one issue. When you set a value for meetOrSlice, exemplary SVG output looks like this: preserveAspectRatio="xMidYMid" meetorslice="slice"

meetOrSlice is actually a parameter of the preserveAspectRatio attribute and thus the output should be: preserveAspectRatio="xMidYMid slice"

Other than that it meets my requirements quite well and the enum approach is cleaner than my quick hack :)

@jfree

This comment has been minimized.

Show comment
Hide comment
@jfree

jfree Sep 15, 2016

Owner

OK, great…thanks for picking that up, I was about to start testing a week or two back then got distracted by other things. I’ll fix it asap.

Best regards,
David

On 15 Sep 2016, at 01:00, sladkoff notifications@github.com wrote:

Sorry for the delay. I only now got the chance to test.

I found one issue. When you set a value for meetOrSlice, exemplary SVG output looks like this: preserveAspectRatio="xMidYMid" meetorslice="slice"

meetOrSlice is actually a parameter of the preserveAspectRatio attribute and thus the output should be: preserveAspectRatio="xMidYMid slice"

Other than that it meets my requirements quite well and the enum approach is cleaner than my quick hack :)


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #4 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ABwDdSapvFucTGPi2jKuqYzXrlW9m_O7ks5qqHyZgaJpZM4JHUMH.

Owner

jfree commented Sep 15, 2016

OK, great…thanks for picking that up, I was about to start testing a week or two back then got distracted by other things. I’ll fix it asap.

Best regards,
David

On 15 Sep 2016, at 01:00, sladkoff notifications@github.com wrote:

Sorry for the delay. I only now got the chance to test.

I found one issue. When you set a value for meetOrSlice, exemplary SVG output looks like this: preserveAspectRatio="xMidYMid" meetorslice="slice"

meetOrSlice is actually a parameter of the preserveAspectRatio attribute and thus the output should be: preserveAspectRatio="xMidYMid slice"

Other than that it meets my requirements quite well and the enum approach is cleaner than my quick hack :)


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #4 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ABwDdSapvFucTGPi2jKuqYzXrlW9m_O7ks5qqHyZgaJpZM4JHUMH.

@jfree

This comment has been minimized.

Show comment
Hide comment
@jfree

jfree Sep 20, 2016

Owner

Committed the fix.

On 15 Sep 2016, at 11:37, David Gilbert david.gilbert@object-refinery.com wrote:

OK, great…thanks for picking that up, I was about to start testing a week or two back then got distracted by other things. I’ll fix it asap.

Best regards,
David

On 15 Sep 2016, at 01:00, sladkoff <notifications@github.com mailto:notifications@github.com> wrote:

Sorry for the delay. I only now got the chance to test.

I found one issue. When you set a value for meetOrSlice, exemplary SVG output looks like this: preserveAspectRatio="xMidYMid" meetorslice="slice"

meetOrSlice is actually a parameter of the preserveAspectRatio attribute and thus the output should be: preserveAspectRatio="xMidYMid slice"

Other than that it meets my requirements quite well and the enum approach is cleaner than my quick hack :)


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #4 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ABwDdSapvFucTGPi2jKuqYzXrlW9m_O7ks5qqHyZgaJpZM4JHUMH.

Owner

jfree commented Sep 20, 2016

Committed the fix.

On 15 Sep 2016, at 11:37, David Gilbert david.gilbert@object-refinery.com wrote:

OK, great…thanks for picking that up, I was about to start testing a week or two back then got distracted by other things. I’ll fix it asap.

Best regards,
David

On 15 Sep 2016, at 01:00, sladkoff <notifications@github.com mailto:notifications@github.com> wrote:

Sorry for the delay. I only now got the chance to test.

I found one issue. When you set a value for meetOrSlice, exemplary SVG output looks like this: preserveAspectRatio="xMidYMid" meetorslice="slice"

meetOrSlice is actually a parameter of the preserveAspectRatio attribute and thus the output should be: preserveAspectRatio="xMidYMid slice"

Other than that it meets my requirements quite well and the enum approach is cleaner than my quick hack :)


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #4 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ABwDdSapvFucTGPi2jKuqYzXrlW9m_O7ks5qqHyZgaJpZM4JHUMH.

@sladkoff

This comment has been minimized.

Show comment
Hide comment
@sladkoff

sladkoff Sep 28, 2016

Looking good on my end.

sladkoff commented Sep 28, 2016

Looking good on my end.

@sladkoff sladkoff closed this Sep 28, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment