diff --git a/draw2dbase/stack_gc.go b/draw2dbase/stack_gc.go index 12723c7..759277b 100644 --- a/draw2dbase/stack_gc.go +++ b/draw2dbase/stack_gc.go @@ -160,6 +160,10 @@ func (gc *StackGraphicContext) ArcTo(cx, cy, rx, ry, startAngle, angle float64) gc.Current.Path.ArcTo(cx, cy, rx, ry, startAngle, angle) } +func (gc *StackGraphicContext) Shift(x, y float64) { + gc.Current.Path.Shift(x, y) +} + func (gc *StackGraphicContext) Close() { gc.Current.Path.Close() } diff --git a/path.go b/path.go index aca14f3..e724328 100644 --- a/path.go +++ b/path.go @@ -22,6 +22,8 @@ type PathBuilder interface { CubicCurveTo(cx1, cy1, cx2, cy2, x, y float64) // ArcTo adds an arc to the current subpath ArcTo(cx, cy, rx, ry, startAngle, angle float64) + // Shift moves every point in the path by x and y + Shift(x, y float64) // Close creates a line from the current point to the last MoveTo // point (if not the same) and mark the path as closed so the // first and last lines join nicely.