clipping simplification

This commit is contained in:
Michael Fogleman 2016-02-26 08:39:32 -05:00
parent 9d56681560
commit 021242611d

View File

@ -425,10 +425,8 @@ func (dc *Context) ClipPreserve() {
if dc.mask == nil { if dc.mask == nil {
dc.mask = clip dc.mask = clip
} else { } else {
r := image.Rect(0, 0, dc.width, dc.height) mask := image.NewAlpha(image.Rect(0, 0, dc.width, dc.height))
mask := image.NewAlpha(r) draw.DrawMask(mask, mask.Bounds(), clip, image.ZP, dc.mask, image.ZP, draw.Over)
draw.DrawMask(mask, r, clip, image.ZP, dc.mask, image.ZP, draw.Over)
draw.DrawMask(mask, r, dc.mask, image.ZP, clip, image.ZP, draw.Over)
dc.mask = mask dc.mask = mask
} }
} }