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

SVG output now supports width and height attibute on top-level SVG ele… #153

Merged
merged 2 commits into from
Jul 17, 2019

Conversation

fractalqb
Copy link

Addresses #152

@fractalqb fractalqb changed the title SVG output now support width and height attibute on top-level SVG ele… SVG output now supports width and height attibute on top-level SVG ele… Jul 10, 2019
@llgcode
Copy link
Owner

llgcode commented Jul 10, 2019

Hi @fractalqb,
Thanks to submit this pull request see my comment in the code.

@fractalqb
Copy link
Author

I had a look at the commits but I couldn't find any comments. As I said, I'm not (yet) a github Pro!

draw2dsvg/svg.go Outdated
@@ -35,6 +35,8 @@ const (
type Svg struct {
XMLName xml.Name `xml:"svg"`
Xmlns string `xml:"xmlns,attr"`
Width float64 `xml:"width,attr,omitempty"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Width and Height must have string type I guess cause you can have some css unit in it. See Dimension type below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are completely right and I was only going for some quick results. I changed it in my fork. Hope it's OK for a pull now.

According to the SVG specification the sizing properties "width"
and "height" can have non-numerical values like "auto" or "128px".
To support this SVG feature the type of the respective values of
the svg element is changed to string.
@llgcode
Copy link
Owner

llgcode commented Jul 17, 2019

It looks ok for me, thanks @fractalqb

@llgcode llgcode merged commit e46834f into llgcode:master Jul 17, 2019
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.

3 participants