mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
Hide Color.Dim / Geometry.Dim
This commit is contained in:
parent
05c0cb5531
commit
4c79f1bccd
@ -1,13 +1,13 @@
|
||||
package matrix
|
||||
|
||||
type affine interface {
|
||||
Dim() int
|
||||
dim() int
|
||||
element(i, j int) float64
|
||||
setElement(i, j int, element float64)
|
||||
}
|
||||
|
||||
func isIdentity(matrix affine) bool {
|
||||
dim := matrix.Dim()
|
||||
dim := matrix.dim()
|
||||
for i := 0; i < dim-1; i++ {
|
||||
for j := 0; j < dim; j++ {
|
||||
element := matrix.element(i, j)
|
||||
@ -22,8 +22,8 @@ func isIdentity(matrix affine) bool {
|
||||
}
|
||||
|
||||
func mul(lhs, rhs, result affine) {
|
||||
dim := lhs.Dim()
|
||||
if dim != rhs.Dim() {
|
||||
dim := lhs.dim()
|
||||
if dim != rhs.dim() {
|
||||
panic("diffrent-sized matrices can't be multiplied")
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ func ColorI() Color {
|
||||
}
|
||||
}
|
||||
|
||||
func (matrix *Color) Dim() int {
|
||||
func (matrix *Color) dim() int {
|
||||
return ColorDim
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ func GeometryI() Geometry {
|
||||
}
|
||||
}
|
||||
|
||||
func (matrix *Geometry) Dim() int {
|
||||
func (matrix *Geometry) dim() int {
|
||||
return GeometryDim
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user