mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
graphics: Deprecated 'Add' func for affine matrices
This commit is contained in:
parent
d80b213184
commit
1a1d7972c1
@ -39,7 +39,8 @@ func (c *ColorM) Concat(other ColorM) {
|
||||
c.impl.Concat(other.impl)
|
||||
}
|
||||
|
||||
// Add adds a color matrix with the other color matrix.
|
||||
// Add is deprecated as of 1.5.0-alpha.
|
||||
// Note that this doesn't make sense in terms of additions two affine matrices.
|
||||
func (c *ColorM) Add(other ColorM) {
|
||||
c.impl.Add(other.impl)
|
||||
}
|
||||
|
@ -47,20 +47,6 @@ func TestColorInit(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m.Add(m)
|
||||
for i := 0; i < ColorMDim-1; i++ {
|
||||
for j := 0; j < ColorMDim; j++ {
|
||||
got := m.Element(i, j)
|
||||
want := 0.0
|
||||
if i == j {
|
||||
want = 2
|
||||
}
|
||||
if want != got {
|
||||
t.Errorf("m.Element(%d, %d) = %f, want %f", i, j, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestColorAssign(t *testing.T) {
|
||||
|
3
geom.go
3
geom.go
@ -39,7 +39,8 @@ func (g *GeoM) Concat(other GeoM) {
|
||||
g.impl.Concat(other.impl)
|
||||
}
|
||||
|
||||
// Add adds a geometry matrix with the other geometry matrix.
|
||||
// Add is deprecated as of 1.5.0-alpha.
|
||||
// Note that this doesn't make sense in terms of additions two affine matrices.
|
||||
func (g *GeoM) Add(other GeoM) {
|
||||
g.impl.Add(other.impl)
|
||||
}
|
||||
|
14
geom_test.go
14
geom_test.go
@ -33,20 +33,6 @@ func TestGeometryInit(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m.Add(m)
|
||||
for i := 0; i < GeoMDim-1; i++ {
|
||||
for j := 0; j < GeoMDim; j++ {
|
||||
got := m.Element(i, j)
|
||||
want := 0.0
|
||||
if i == j {
|
||||
want = 2
|
||||
}
|
||||
if want != got {
|
||||
t.Errorf("m.Element(%d, %d) = %f, want %f", i, j, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestGeometryAssign(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user