internal/color: Remove Add

This commit is contained in:
Hajime Hoshi 2021-01-27 02:37:37 +09:00
parent 599b3501fd
commit 14abc28d3a

View File

@ -438,43 +438,6 @@ func (c *ColorM) Concat(other *ColorM) *ColorM {
}
}
// Add is deprecated.
func (c *ColorM) Add(other *ColorM) *ColorM {
lhsb := colorMIdentityBody
lhst := colorMIdentityTranslate
rhsb := colorMIdentityBody
rhst := colorMIdentityTranslate
if other.isInited() {
if other.body != nil {
lhsb = other.body
}
if other.translate != nil {
lhst = other.translate
}
}
if c.isInited() {
if c.body != nil {
rhsb = c.body
}
if c.translate != nil {
rhst = c.translate
}
}
newC := &ColorM{
body: make([]float32, 16),
translate: make([]float32, 4),
}
for i := range lhsb {
newC.body[i] = lhsb[i] + rhsb[i]
}
for i := range lhst {
newC.translate[i] = lhst[i] + rhst[i]
}
return newC
}
// Scale scales the matrix by (r, g, b, a).
func (c *ColorM) Scale(r, g, b, a float32) *ColorM {
if !c.isInited() {