From 5bc09acb41fa10a1b436780daeaaf034b15483f6 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 3 Jul 2020 12:48:20 +0900 Subject: [PATCH] ebiten: Rename det to det2x2 det doesn't calculate the actual det of the matrix. --- geom.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geom.go b/geom.go index 84152261c..96e8a1630 100644 --- a/geom.go +++ b/geom.go @@ -179,20 +179,20 @@ func (g *GeoM) Skew(skewX, skewY float64) { g.ty = ty } -func (g *GeoM) det() float64 { +func (g *GeoM) det2x2() float64 { return (g.a_1+1)*(g.d_1+1) - g.b*g.c } // IsInvertible returns a boolean value indicating // whether the matrix g is invertible or not. func (g *GeoM) IsInvertible() bool { - return g.det() != 0 + return g.det2x2() != 0 } // Invert inverts the matrix. // If g is not invertible, Invert panics. func (g *GeoM) Invert() { - det := g.det() + det := g.det2x2() if det == 0 { panic("ebiten: g is not invertible") }