diff --git a/draw2dkit/draw2dkit.go b/draw2dkit/draw2dkit.go index 1cb3820..968fb80 100644 --- a/draw2dkit/draw2dkit.go +++ b/draw2dkit/draw2dkit.go @@ -1,7 +1,7 @@ // Copyright 2010 The draw2d Authors. All rights reserved. // created: 13/12/2010 by Laurent Le Goff -// Package draw2dkit procides helpers to draw common figure and draw using a Path or a GraphicContext +// Package draw2dkit provides helpers to draw common figures using a Path or a GraphicContext package draw2dkit import ( @@ -9,7 +9,7 @@ import ( "math" ) -// Rectangle draws a rectangle using a PathBuilder +// Rectangle draws a rectangle using a path func Rectangle(path draw2d.PathBuilder, x1, y1, x2, y2 float64) { path.MoveTo(x1, y1) path.LineTo(x2, y1) @@ -18,7 +18,7 @@ func Rectangle(path draw2d.PathBuilder, x1, y1, x2, y2 float64) { path.Close() } -// RoundedRectangle draws a rounded rectangle using a PathBuilder +// RoundedRectangle draws a rounded rectangle using a path func RoundedRectangle(path draw2d.PathBuilder, x1, y1, x2, y2, arcWidth, arcHeight float64) { arcWidth = arcWidth / 2 arcHeight = arcHeight / 2 @@ -33,13 +33,13 @@ func RoundedRectangle(path draw2d.PathBuilder, x1, y1, x2, y2, arcWidth, arcHeig path.Close() } -// Ellipse draws an ellipse using a PathBuilder +// Ellipse draws an ellipse using a path func Ellipse(path draw2d.PathBuilder, cx, cy, rx, ry float64) { path.ArcTo(cx, cy, rx, ry, 0, -math.Pi*2) path.Close() } -// Circle draws a circle using a PathBuilder +// Circle draws a circle using a path func Circle(path draw2d.PathBuilder, cx, cy, radius float64) { path.ArcTo(cx, cy, radius, radius, 0, -math.Pi*2) path.Close() diff --git a/draw2dkit/droid.go b/draw2dkit/droid.go index 7114149..0adfe42 100644 --- a/draw2dkit/droid.go +++ b/draw2dkit/droid.go @@ -5,6 +5,7 @@ import ( "math" ) +// Droid draws a droid at specified position func Droid(gc draw2d.GraphicContext, x, y float64) { gc.SetLineCap(draw2d.RoundCap) gc.SetLineWidth(5) diff --git a/draw2dkit/gopher.go b/draw2dkit/gopher.go index f2b743a..b46a38e 100644 --- a/draw2dkit/gopher.go +++ b/draw2dkit/gopher.go @@ -9,7 +9,7 @@ import ( "github.com/llgcode/draw2d" ) -// Gopher draw a gopher using a gc thanks to https://github.com/golang-samples/gopher-vector/ +// Gopher draw a gopher using a GraphicContext thanks to https://github.com/golang-samples/gopher-vector/ func Gopher(gc draw2d.GraphicContext, x, y, w, h float64) { // Initialize Stroke Attribute gc.SetLineWidth(3)