@@ -88,45 +88,49 @@ func (svg *SVG) genattr(ns []string) {
8888// Start begins the SVG document with the width w and height h.
8989// Other attributes may be optionally added, for example viewbox or additional namespaces
9090// Standard Reference: http://www.w3.org/TR/SVG11/struct.html#SVGElement
91- func (svg * SVG ) Start (w int , h int , ns ... string ) {
91+ func (svg * SVG ) Start (w int , h int , attributes ... string ) {
9292 svg .printf (svginitfmt , svgtop , w , "" , h , "" )
93- svg .genattr (ns )
93+ svg .genattr (attributes )
9494}
9595
9696// Startunit begins the SVG document, with width and height in the specified units
9797// Other attributes may be optionally added, for example viewbox or additional namespaces
98- func (svg * SVG ) Startunit (w int , h int , unit string , ns ... string ) {
98+ func (svg * SVG ) Startunit (w int , h int , unit string , attributes ... string ) {
9999 svg .printf (svginitfmt , svgtop , w , unit , h , unit )
100- svg .genattr (ns )
100+ svg .genattr (attributes )
101101}
102102
103103// Startpercent begins the SVG document, with width and height as percentages
104104// Other attributes may be optionally added, for example viewbox or additional namespaces
105- func (svg * SVG ) Startpercent (w int , h int , ns ... string ) {
105+ func (svg * SVG ) Startpercent (w int , h int , attributes ... string ) {
106106 svg .printf (svginitfmt , svgtop , w , "%" , h , "%" )
107- svg .genattr (ns )
107+ svg .genattr (attributes )
108108}
109109
110110// Startview begins the SVG document, with the specified width, height, and viewbox
111111// Other attributes may be optionally added, for example viewbox or additional namespaces
112- func (svg * SVG ) Startview (w , h , minx , miny , vw , vh int ) {
112+ func (svg * SVG ) Startview (w , h , minx , miny , vw , vh int , attributes ... string ) {
113113 svg .Start (w , h , fmt .Sprintf (vbfmt , minx , miny , vw , vh ))
114+ svg .genattr (attributes )
114115}
115116
116- func (svg * SVG ) StartviewUnit (w , h int , unit string , minx , miny , vw , vh int ) {
117+ // Startunit begins the SVG document, with width and height in the specified units, and viewbox
118+ // Other attributes may be optionally added, for example viewbox or additional namespaces
119+ func (svg * SVG ) StartviewUnit (w , h int , unit string , minx , miny , vw , vh int , attributes ... string ) {
117120 svg .Startunit (w , h , unit , fmt .Sprintf (vbfmt , minx , miny , vw , vh ))
121+ svg .genattr (attributes )
118122}
119123
120124// Startraw begins the SVG document, passing arbitrary attributes
121- func (svg * SVG ) Startraw (ns ... string ) {
125+ func (svg * SVG ) Startraw (attributes ... string ) {
122126 svg .printf (svgtop )
123- svg .genattr (ns )
127+ svg .genattr (attributes )
124128}
125129
126130// End the SVG document
127131func (svg * SVG ) End () { svg .println ("</svg>" ) }
128132
129- // linkembed defines an element with a specified type,
133+ // linkembed defines an element with a specified type,
130134// (for example "application/javascript", or "text/css").
131135// if the first variadic argument is a link, use only the link reference.
132136// Otherwise, treat those arguments as the text of the script (marked up as CDATA).
0 commit comments