Skip to content

Commit

Permalink
Adding optimize function to alias packer
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Ray committed Jul 30, 2021
1 parent cb91db0 commit 6a33149
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packer/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func (packer AliasPacker) IdOf(alias interface{}) int {
return packer.alias[alias]
}

// Get the alias from the given internal integer ID
func (packer AliasPacker) AliasOf(id int) interface{} {
for k, v := range packer.alias {
if v == id {
Expand Down Expand Up @@ -78,3 +79,7 @@ func (packer AliasPacker) Bounds() pixel.Rect {
func (packer *AliasPacker) Picture() pixel.Picture {
return packer.base.Picture()
}

func (packer *AliasPacker) Optimize() {
packer.base.Optimize()
}

0 comments on commit 6a33149

Please sign in to comment.