diff --git a/draw2dbase/stack_gc.go b/draw2dbase/stack_gc.go index 12723c7..8c394fd 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) CopyPath() *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..d76a7ca 100644 --- a/gc.go +++ b/gc.go @@ -14,6 +14,8 @@ type GraphicContext interface { PathBuilder // BeginPath creates a new path BeginPath() + // CopyPath copies the current path, then returns it + CopyPath() *Path // GetMatrixTransform returns the current transformation matrix GetMatrixTransform() Matrix // SetMatrixTransform sets the current transformation matrix