Push/Pop doesn't affect Path
This commit is contained in:
parent
5e6e015a82
commit
dbef31de34
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user