Skip to content

Commit 6f03f10

Browse files
committed
Minor changes
1 parent 3af25f5 commit 6f03f10

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

draw2dsvg/doc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// created: 16/12/2017 by Drahoslav Bednář
33

44
// Package draw2svg provides a graphic context that can draw
5-
// vector graphics and text on svg file using the svgo package.
5+
// vector graphics and text on svg file.
66
//
77
// Quick Start
88
// The following Go code geneartes a simple drawing and saves it
99
// to a svg document:
10-
// // TODO
10+
// TODO
1111
package draw2dsvg

draw2dsvg/gc.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,13 @@ import (
1111
"strings"
1212
)
1313

14-
const ()
15-
16-
var ()
17-
1814
type drawType int
1915

2016
const (
2117
filled drawType = 1 << iota
2218
stroked
2319
)
2420

25-
type SVG bytes.Buffer
26-
27-
func NewSvg() *Svg {
28-
return &Svg{
29-
Xmlns: "http://www.w3.org/2000/svg",
30-
FillStroke: FillStroke{Fill: "none", Stroke: "none"},
31-
}
32-
}
33-
3421
// GraphicContext implements the draw2d.GraphicContext interface
3522
// It provides draw2d with a svg backend
3623
type GraphicContext struct {
@@ -210,5 +197,5 @@ func (gc *GraphicContext) GetStringBounds(s string) (left, top, right, bottom fl
210197

211198
// CreateStringPath creates a path from the string s at x, y
212199
func (gc *GraphicContext) CreateStringPath(text string, x, y float64) (cursor float64) {
213-
return 0
200+
return 0 // TODO use glyphCache for creating string path
214201
}

draw2dsvg/svg.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ type Svg struct {
1616
FillStroke
1717
}
1818

19+
func NewSvg() *Svg {
20+
return &Svg{
21+
Xmlns: "http://www.w3.org/2000/svg",
22+
FillStroke: FillStroke{Fill: "none", Stroke: "none"},
23+
}
24+
}
25+
1926
type Group struct {
2027
FillStroke
2128
Transform string `xml:"transform,attr,omitempty"`

0 commit comments

Comments
 (0)