Fix some errors in iso->pix->iso conversions, add debugging
Maps now render a bit more properly, and our mouse position can be correctly assigned to a cell. Kind of, mostly.
This commit is contained in:
21
internal/scenario/draw_test.go
Normal file
21
internal/scenario/draw_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package scenario
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestCARTtoISOtoCART(t *testing.T) {
|
||||
for i := 0; i < 120; i++ {
|
||||
for j := 0; j < 120; j++ {
|
||||
orig := IsoPt{X: float64(i), Y: float64(j)}
|
||||
asPix := orig.ToCart()
|
||||
andBack := asPix.ToISO()
|
||||
|
||||
t.Logf("%v,%v: asPix = %v", i, j, asPix)
|
||||
|
||||
require.Equal(t, orig, andBack)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user