mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 20:18:59 +01:00
Concat / Add returns the receiver
This commit is contained in:
parent
ffab448d40
commit
20da9bffbb
@ -59,7 +59,8 @@ func (c ColorM) Element(i, j int) float64 {
|
||||
}
|
||||
|
||||
// Concat multiplies a color matrix with the other color matrix.
|
||||
func (c *ColorM) Concat(other ColorM) {
|
||||
// This returns c.
|
||||
func (c *ColorM) Concat(other ColorM) ColorM {
|
||||
if !c.initialized {
|
||||
c.es = colorMatrixEsI()
|
||||
c.initialized = true
|
||||
@ -67,10 +68,12 @@ func (c *ColorM) Concat(other ColorM) {
|
||||
result := ColorM{}
|
||||
mul(&other, c, &result)
|
||||
*c = result
|
||||
return *c
|
||||
}
|
||||
|
||||
// Add adds a color matrix with the other color matrix.
|
||||
func (c *ColorM) Add(other ColorM) {
|
||||
// This returns c.
|
||||
func (c *ColorM) Add(other ColorM) ColorM {
|
||||
if !c.initialized {
|
||||
c.es = colorMatrixEsI()
|
||||
c.initialized = true
|
||||
@ -78,6 +81,7 @@ func (c *ColorM) Add(other ColorM) {
|
||||
result := ColorM{}
|
||||
add(&other, c, &result)
|
||||
*c = result
|
||||
return *c
|
||||
}
|
||||
|
||||
// SetElement sets an element at (i, j).
|
||||
|
@ -52,7 +52,8 @@ func (g GeoM) Element(i, j int) float64 {
|
||||
}
|
||||
|
||||
// Concat multiplies a geometry matrix with the other geometry matrix.
|
||||
func (g *GeoM) Concat(other GeoM) {
|
||||
// This returns g.
|
||||
func (g *GeoM) Concat(other GeoM) GeoM {
|
||||
if !g.initialized {
|
||||
g.es = geometryMatrixEsI()
|
||||
g.initialized = true
|
||||
@ -60,10 +61,12 @@ func (g *GeoM) Concat(other GeoM) {
|
||||
result := GeoM{}
|
||||
mul(&other, g, &result)
|
||||
*g = result
|
||||
return *g
|
||||
}
|
||||
|
||||
// Add adds a geometry matrix with the other geometry matrix.
|
||||
func (g *GeoM) Add(other GeoM) {
|
||||
// This returns g.
|
||||
func (g *GeoM) Add(other GeoM) GeoM {
|
||||
if !g.initialized {
|
||||
g.es = geometryMatrixEsI()
|
||||
g.initialized = true
|
||||
@ -71,6 +74,7 @@ func (g *GeoM) Add(other GeoM) {
|
||||
result := GeoM{}
|
||||
add(&other, g, &result)
|
||||
*g = result
|
||||
return *g
|
||||
}
|
||||
|
||||
// SetElement sets an element at (i, j).
|
||||
|
Loading…
Reference in New Issue
Block a user