From 021242611dfba696ea28cc5bf83dbcc976523700 Mon Sep 17 00:00:00 2001 From: Michael Fogleman Date: Fri, 26 Feb 2016 08:39:32 -0500 Subject: [PATCH] clipping simplification --- context.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/context.go b/context.go index 75686b9..0d9df50 100644 --- a/context.go +++ b/context.go @@ -425,10 +425,8 @@ func (dc *Context) ClipPreserve() { if dc.mask == nil { dc.mask = clip } else { - r := image.Rect(0, 0, dc.width, dc.height) - mask := image.NewAlpha(r) - 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) + mask := image.NewAlpha(image.Rect(0, 0, dc.width, dc.height)) + draw.DrawMask(mask, mask.Bounds(), clip, image.ZP, dc.mask, image.ZP, draw.Over) dc.mask = mask } }