Push/Pop doesn't affect Path

This commit is contained in:
Michael Fogleman 2016-02-19 19:45:49 -05:00
parent 5e6e015a82
commit dbef31de34

View File

@ -377,13 +377,13 @@ func (dc *Context) TransformPoint(x, y float64) (tx, ty float64) {
func (dc *Context) Push() { func (dc *Context) Push() {
x := *dc x := *dc
x.path = make(raster.Path, len(dc.path))
copy(x.path, dc.path)
dc.stack = append(dc.stack, &x) dc.stack = append(dc.stack, &x)
} }
func (dc *Context) Pop() { func (dc *Context) Pop() {
before := *dc
s := dc.stack s := dc.stack
x, s := s[len(s)-1], s[:len(s)-1] x, s := s[len(s)-1], s[:len(s)-1]
*dc = *x *dc = *x
dc.path = before.path
} }