diff --git a/draw2dbase/stack_gc.go b/draw2dbase/stack_gc.go index 12723c7..a5b01d8 100644 --- a/draw2dbase/stack_gc.go +++ b/draw2dbase/stack_gc.go @@ -132,6 +132,10 @@ func (gc *StackGraphicContext) BeginPath() { gc.Current.Path.Clear() } +func (gc *StackGraphicContext) GetPath() draw2d.Path { + return *gc.Current.Path.Copy() +} + func (gc *StackGraphicContext) IsEmpty() bool { return gc.Current.Path.IsEmpty() } diff --git a/gc.go b/gc.go index 6266c16..af34060 100644 --- a/gc.go +++ b/gc.go @@ -14,6 +14,8 @@ type GraphicContext interface { PathBuilder // BeginPath creates a new path BeginPath() + // GetPath copies the current path, then returns it + GetPath() Path // GetMatrixTransform returns the current transformation matrix GetMatrixTransform() Matrix // SetMatrixTransform sets the current transformation matrix