From d32d0cabac439a255ec3a192c1aab7fc569ff9de Mon Sep 17 00:00:00 2001 From: "legoff.laurent" Date: Tue, 23 Nov 2010 17:20:58 +0000 Subject: [PATCH] resolve bug on ClearRect --- draw2d/src/pkg/draw2d/draw2d.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draw2d/src/pkg/draw2d/draw2d.go b/draw2d/src/pkg/draw2d/draw2d.go index 8355152..bada6bd 100644 --- a/draw2d/src/pkg/draw2d/draw2d.go +++ b/draw2d/src/pkg/draw2d/draw2d.go @@ -76,7 +76,7 @@ func (gc *GraphicContext) Clear() { func (gc *GraphicContext) ClearRect(x1, y1, x2, y2 int) { imageColor := image.NewColorImage(gc.current.fillColor) - draw.Draw(gc.PaintedImage, gc.PaintedImage.Bounds(), imageColor, image.ZP) + draw.Draw(gc.PaintedImage, image.Rect(x1, y1, x2, y2), imageColor, image.ZP) } func (gc *GraphicContext) SetStrokeColor(c image.Color) {