diff --git a/draw2d/src/pkg/draw2d/draw2d.go b/draw2d/src/pkg/draw2d/draw2d.go index 4cf3516..06a7bbf 100644 --- a/draw2d/src/pkg/draw2d/draw2d.go +++ b/draw2d/src/pkg/draw2d/draw2d.go @@ -77,7 +77,7 @@ func NewGraphicContext(pi *image.RGBA) *GraphicContext { return gc } -func (gc *GraphicContext) GetMatrixTransform() (tr MatrixTransform) { +func (gc *GraphicContext) GetMatrixTransform() MatrixTransform { return gc.current.tr } @@ -224,14 +224,18 @@ func (gc *GraphicContext) DrawImage(image image.Image) { } } -func (gc *GraphicContext) LastPoint() (x, y float) { - return gc.current.path.LastPoint() -} - func (gc *GraphicContext) BeginPath() { gc.current.path = new(PathStorage) } +func (gc *GraphicContext) IsEmpty() bool{ + return gc.current.path.IsEmpty() +} + +func (gc *GraphicContext) LastPoint() (float, float){ + return gc.current.path.LastPoint() +} + func (gc *GraphicContext) MoveTo(x, y float) { gc.current.path.MoveTo(x, y) } diff --git a/draw2d/src/pkg/draw2d/path_storage.go b/draw2d/src/pkg/draw2d/path_storage.go index 95cf158..edb3e99 100644 --- a/draw2d/src/pkg/draw2d/path_storage.go +++ b/draw2d/src/pkg/draw2d/path_storage.go @@ -41,7 +41,7 @@ func (p *PathStorage) LastPoint() (x, y float) { return p.x, p.y } -func (p *PathStorage) isEmpty() bool { +func (p *PathStorage) IsEmpty() bool { return len(p.commands) == 0 }