Show SetElement function

This commit is contained in:
Hajime Hoshi 2014-12-26 10:33:50 +09:00
parent cf1b1ed15e
commit 3e5688e2e1
3 changed files with 7 additions and 5 deletions

View File

@ -17,7 +17,7 @@ package ebiten
type affine interface {
dim() int
Element(i, j int) float64
setElement(i, j int, element float64)
SetElement(i, j int, element float64)
}
func isIdentity(ebiten affine) bool {
@ -43,7 +43,7 @@ func add(lhs, rhs, result affine) {
for i := 0; i < dim-1; i++ {
for j := 0; j < dim; j++ {
result.setElement(i, j, lhs.Element(i, j)+rhs.Element(i, j))
result.SetElement(i, j, lhs.Element(i, j)+rhs.Element(i, j))
}
}
}
@ -64,7 +64,7 @@ func mul(lhs, rhs, result affine) {
if j == dim-1 {
element += lhs.Element(i, j)
}
result.setElement(i, j, element)
result.SetElement(i, j, element)
}
}
}

View File

@ -67,7 +67,8 @@ func (c *ColorMatrix) Add(other ColorMatrix) {
*c = result
}
func (c *ColorMatrix) setElement(i, j int, element float64) {
// SetElement sets an element at (i, j).
func (c *ColorMatrix) SetElement(i, j int, element float64) {
c.es[i][j] = element
}

View File

@ -60,7 +60,8 @@ func (g *GeometryMatrix) Add(other GeometryMatrix) {
*g = result
}
func (g *GeometryMatrix) setElement(i, j int, element float64) {
// SetElement sets an element at (i, j).
func (g *GeometryMatrix) SetElement(i, j int, element float64) {
g.es[i][j] = element
}