text/v2: change the signature of NewMultiFace

Updates #2845
This commit is contained in:
Hajime Hoshi 2023-12-02 22:50:55 +09:00
parent 5790597a15
commit dfa058a961
2 changed files with 5 additions and 6 deletions

View File

@ -74,7 +74,7 @@ func (g *Game) Update() error {
Size: 32,
}
g.face = text.NewMultiFace([]text.Face{en, ja})
g.face = text.NewMultiFace(en, ja)
}
return nil
}

View File

@ -31,11 +31,10 @@ type MultiFace struct {
}
// NewMultiFace creates a new MultiFace from the given faces.
func NewMultiFace(faces []Face) *MultiFace {
m := &MultiFace{}
m.faces = make([]Face, len(faces))
copy(m.faces, faces)
return m
func NewMultiFace(faces ...Face) *MultiFace {
return &MultiFace{
faces: faces,
}
}
// Metrics implements Face.