diff --git a/ebitenutil/shapes.go b/ebitenutil/shapes.go index 1cea5ad9b..0027bb96e 100644 --- a/ebitenutil/shapes.go +++ b/ebitenutil/shapes.go @@ -28,7 +28,7 @@ var ( func init() { emptyImage, _ = ebiten.NewImage(1, 1) - _ = emptyImage.Fill(color.White) + emptyImage.Fill(color.White) } // DrawLine draws a line segment on the given destination dst. diff --git a/image.go b/image.go index 098a6ac7c..066dbc974 100644 --- a/image.go +++ b/image.go @@ -67,23 +67,18 @@ func (i *Image) isSubImage() bool { // Clear resets the pixels of the image into 0. // // When the image is disposed, Clear does nothing. -// -// Clear always returns nil as of 1.5.0. -func (i *Image) Clear() error { +func (i *Image) Clear() { i.Fill(color.Transparent) - return nil } // Fill fills the image with a solid color. // // When the image is disposed, Fill does nothing. -// -// Fill always returns nil as of 1.5.0. -func (i *Image) Fill(clr color.Color) error { +func (i *Image) Fill(clr color.Color) { i.copyCheck() if i.isDisposed() { - return nil + return } // TODO: Implement this. @@ -92,7 +87,6 @@ func (i *Image) Fill(clr color.Color) error { } i.mipmap.Fill(color.RGBAModel.Convert(clr).(color.RGBA)) - return nil } func canSkipMipmap(geom GeoM, filter driver.Filter) bool { diff --git a/image_test.go b/image_test.go index 1d026476d..443d06d66 100644 --- a/image_test.go +++ b/image_test.go @@ -135,14 +135,8 @@ func TestImageComposition(t *testing.T) { return } - if err := img2.Fill(img2Color); err != nil { - t.Fatal(err) - return - } - if err := img3.Fill(img3Color); err != nil { - t.Fatal(err) - return - } + img2.Fill(img2Color) + img3.Fill(img3Color) img_12_3, err := NewImage(w, h) if err != nil { t.Fatal(err) @@ -161,14 +155,8 @@ func TestImageComposition(t *testing.T) { return } - if err := img2.Fill(img2Color); err != nil { - t.Fatal(err) - return - } - if err := img3.Fill(img3Color); err != nil { - t.Fatal(err) - return - } + img2.Fill(img2Color) + img3.Fill(img3Color) img_1_23, err := NewImage(w, h) if err != nil { t.Fatal(err) @@ -428,10 +416,7 @@ func TestImageCompositeModeLighter(t *testing.T) { t.Fatal(err) return } - if err := img1.Fill(color.RGBA{0x01, 0x02, 0x03, 0x04}); err != nil { - t.Fatal(err) - return - } + img1.Fill(color.RGBA{0x01, 0x02, 0x03, 0x04}) op := &DrawImageOptions{} op.CompositeMode = CompositeModeLighter if err := img1.DrawImage(img0, op); err != nil { @@ -512,10 +497,7 @@ func TestImageFill(t *testing.T) { return } clr := &mutableRGBA{0x80, 0x80, 0x80, 0x80} - if err := img.Fill(clr); err != nil { - t.Fatal(err) - return - } + img.Fill(clr) clr.r = 0 for j := 0; j < h; j++ { for i := 0; i < w; i++ {