From 6f03f106f6af2ba15539888efd423e6dd510a38e Mon Sep 17 00:00:00 2001 From: Drahoslav Date: Wed, 27 Dec 2017 12:32:23 +0100 Subject: [PATCH] Minor changes --- draw2dsvg/doc.go | 4 ++-- draw2dsvg/gc.go | 15 +-------------- draw2dsvg/svg.go | 7 +++++++ 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/draw2dsvg/doc.go b/draw2dsvg/doc.go index f07708f..033aaa2 100644 --- a/draw2dsvg/doc.go +++ b/draw2dsvg/doc.go @@ -2,10 +2,10 @@ // created: 16/12/2017 by Drahoslav Bednář // Package draw2svg provides a graphic context that can draw -// vector graphics and text on svg file using the svgo package. +// vector graphics and text on svg file. // // Quick Start // The following Go code geneartes a simple drawing and saves it // to a svg document: -// // TODO +// TODO package draw2dsvg diff --git a/draw2dsvg/gc.go b/draw2dsvg/gc.go index 884828b..ac1f98c 100644 --- a/draw2dsvg/gc.go +++ b/draw2dsvg/gc.go @@ -11,10 +11,6 @@ import ( "strings" ) -const () - -var () - type drawType int const ( @@ -22,15 +18,6 @@ const ( stroked ) -type SVG bytes.Buffer - -func NewSvg() *Svg { - return &Svg{ - Xmlns: "http://www.w3.org/2000/svg", - FillStroke: FillStroke{Fill: "none", Stroke: "none"}, - } -} - // GraphicContext implements the draw2d.GraphicContext interface // It provides draw2d with a svg backend type GraphicContext struct { @@ -210,5 +197,5 @@ func (gc *GraphicContext) GetStringBounds(s string) (left, top, right, bottom fl // CreateStringPath creates a path from the string s at x, y func (gc *GraphicContext) CreateStringPath(text string, x, y float64) (cursor float64) { - return 0 + return 0 // TODO use glyphCache for creating string path } diff --git a/draw2dsvg/svg.go b/draw2dsvg/svg.go index 0867036..baad46e 100644 --- a/draw2dsvg/svg.go +++ b/draw2dsvg/svg.go @@ -16,6 +16,13 @@ type Svg struct { FillStroke } +func NewSvg() *Svg { + return &Svg{ + Xmlns: "http://www.w3.org/2000/svg", + FillStroke: FillStroke{Fill: "none", Stroke: "none"}, + } +} + type Group struct { FillStroke Transform string `xml:"transform,attr,omitempty"`