From dbef31de34a1bb094a372bfba902c58e9e570a24 Mon Sep 17 00:00:00 2001 From: Michael Fogleman Date: Fri, 19 Feb 2016 19:45:49 -0500 Subject: [PATCH] Push/Pop doesn't affect Path --- context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/context.go b/context.go index 2701fc6..6a0b850 100644 --- a/context.go +++ b/context.go @@ -377,13 +377,13 @@ func (dc *Context) TransformPoint(x, y float64) (tx, ty float64) { func (dc *Context) Push() { x := *dc - x.path = make(raster.Path, len(dc.path)) - copy(x.path, dc.path) dc.stack = append(dc.stack, &x) } func (dc *Context) Pop() { + before := *dc s := dc.stack x, s := s[len(s)-1], s[:len(s)-1] *dc = *x + dc.path = before.path }