Remove internal/conv
This sets font rendering back a little bit, but not much.
This commit is contained in:
@@ -14,11 +14,12 @@ var (
|
||||
type Set struct {
|
||||
assets *AssetStore
|
||||
|
||||
raw *sets.MapSet
|
||||
raw *sets.MapSet
|
||||
NumObjects int
|
||||
}
|
||||
|
||||
func (s *Set) Object(idx int) (*Object, error) {
|
||||
if idx < 0 || idx >= len(s.raw.Palette) {
|
||||
if idx < 0 || idx >= s.NumObjects {
|
||||
return nil, ErrOutOfBounds
|
||||
}
|
||||
|
||||
@@ -27,6 +28,7 @@ func (s *Set) Object(idx int) (*Object, error) {
|
||||
|
||||
func (a *AssetStore) Set(name string) (*Set, error) {
|
||||
name = canonical(name)
|
||||
|
||||
if set, ok := a.sets[name]; ok {
|
||||
return set, nil
|
||||
}
|
||||
@@ -43,8 +45,9 @@ func (a *AssetStore) Set(name string) (*Set, error) {
|
||||
}
|
||||
|
||||
set := &Set{
|
||||
assets: a,
|
||||
raw: raw,
|
||||
assets: a,
|
||||
raw: raw,
|
||||
NumObjects: len(raw.Palette),
|
||||
}
|
||||
a.sets[name] = set
|
||||
|
||||
|
Reference in New Issue
Block a user