Skip to content

Commit

Permalink
Merge pull request #165 from ph1048/master
Browse files Browse the repository at this point in the history
Fixed ClearRect unable to clear transparent image
  • Loading branch information
llgcode authored Mar 13, 2021
2 parents 0413b5a + 21ec306 commit 577c1ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion draw2dimg/ftgc.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (gc *GraphicContext) Clear() {
// ClearRect fills the current canvas with a default transparent color at the specified rectangle
func (gc *GraphicContext) ClearRect(x1, y1, x2, y2 int) {
imageColor := image.NewUniform(gc.Current.FillColor)
draw.Draw(gc.img, image.Rect(x1, y1, x2, y2), imageColor, image.ZP, draw.Over)
draw.Draw(gc.img, image.Rect(x1, y1, x2, y2), imageColor, image.ZP, draw.Src)
}

// DrawImage draws an image into dest using an affine transformation matrix, an op and a filter
Expand Down

0 comments on commit 577c1ea

Please sign in to comment.