Skip to content

Commit

Permalink
GradientComposite: Stop wasting memory
Browse files Browse the repository at this point in the history
  • Loading branch information
lxn committed Jul 10, 2017
1 parent 329f317 commit 185844b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gradientcomposite.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,12 @@ func (gc *GradientComposite) updateBackground() error {
gc.brush = nil
}

if gc.vertical {
bounds.Width = 1
} else {
bounds.Height = 1
}

bmp, err := NewBitmap(bounds.Size())
if err != nil {
return err
Expand Down

0 comments on commit 185844b

Please sign in to comment.