Bug fix: Scale and Translate

This commit is contained in:
Hajime Hoshi 2015-01-03 19:18:09 +09:00
parent ab2b884c49
commit c53695eb56
2 changed files with 10 additions and 6 deletions

View File

@ -83,10 +83,12 @@ func (c *ColorM) Scale(r, g, b, a float64) {
if !c.initialized {
*c = colorMI
}
c.es[0][0] *= r
c.es[1][1] *= g
c.es[2][2] *= b
c.es[3][3] *= a
for i := 0; i < ColorMDim; i++ {
c.es[0][i] *= r
c.es[1][i] *= g
c.es[2][i] *= b
c.es[3][i] *= a
}
}
func (c *ColorM) Translate(r, g, b, a float64) {

View File

@ -76,8 +76,10 @@ func (g *GeoM) Scale(x, y float64) {
if !g.initialized {
*g = geoMI
}
g.es[0][0] *= x
g.es[1][1] *= y
for i := 0; i < GeoMDim; i++ {
g.es[0][i] *= x
g.es[1][i] *= y
}
}
func (g *GeoM) Translate(tx, ty float64) {