internal/ui: rename variables

This commit is contained in:
Hajime Hoshi 2022-03-20 16:51:23 +09:00
parent c3e855ab02
commit 696bbc088f
2 changed files with 6 additions and 6 deletions

View File

@ -54,7 +54,7 @@ func skipTooSlowTests(t *testing.T) bool {
} }
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
ui.SetPanicOnErrorAtImageAtForTesting(true) ui.SetPanicOnErrorOnReadingPixelsForTesting(true)
t.MainWithRunLoop(m) t.MainWithRunLoop(m)
} }

View File

@ -22,12 +22,12 @@ import (
"github.com/hajimehoshi/ebiten/v2/internal/mipmap" "github.com/hajimehoshi/ebiten/v2/internal/mipmap"
) )
// panicOnErrorAtImageAt indicates whether (*Image).At panics on an error or not. // panicOnErrorOnReadingPixels indicates whether reading pixels panics on an error or not.
// This value is set only on testing. // This value is set only on testing.
var panicOnErrorAtImageAt bool var panicOnErrorOnReadingPixels bool
func SetPanicOnErrorAtImageAtForTesting(value bool) { func SetPanicOnErrorOnReadingPixelsForTesting(value bool) {
panicOnErrorAtImageAt = value panicOnErrorOnReadingPixels = value
} }
type Image struct { type Image struct {
@ -89,7 +89,7 @@ func (i *Image) Pixels(x, y, width, height int) []byte {
pix, err := i.mipmap.Pixels(graphicsDriver(), x, y, width, height) pix, err := i.mipmap.Pixels(graphicsDriver(), x, y, width, height)
if err != nil { if err != nil {
if panicOnErrorAtImageAt { if panicOnErrorOnReadingPixels {
panic(err) panic(err)
} }
theGlobalState.setError(err) theGlobalState.setError(err)