mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-13 04:22:05 +01:00
Cleanup
This commit is contained in:
parent
5e8d969034
commit
4601cffaba
@ -30,3 +30,7 @@ func (g *glyphAtlas) NewImage(w, h int) *atlas.Image {
|
|||||||
|
|
||||||
return g.NewImage(w, h)
|
return g.NewImage(w, h)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (g *glyphAtlas) Free(img *atlas.Image) {
|
||||||
|
g.atlas.Free(img)
|
||||||
|
}
|
||||||
|
@ -93,7 +93,7 @@ func (g *glyphImageCache[Key]) getOrCreate(face Face, key Key, create func(a *gl
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
delete(g.cache, key)
|
delete(g.cache, key)
|
||||||
g.atlas.atlas.Free(e.image)
|
g.atlas.Free(e.image)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ package text
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"image"
|
"image"
|
||||||
"image/color"
|
|
||||||
"image/draw"
|
"image/draw"
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
@ -26,7 +25,6 @@ import (
|
|||||||
"github.com/go-text/typesetting/opentype/api"
|
"github.com/go-text/typesetting/opentype/api"
|
||||||
"golang.org/x/image/math/fixed"
|
"golang.org/x/image/math/fixed"
|
||||||
|
|
||||||
"github.com/hajimehoshi/ebiten/v2"
|
|
||||||
"github.com/hajimehoshi/ebiten/v2/vector"
|
"github.com/hajimehoshi/ebiten/v2/vector"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -78,13 +76,6 @@ func segmentsToBounds(segs []api.Segment) fixed.Rectangle26_6 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var whiteImage = ebiten.NewImage(3, 3)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
whiteImage.Fill(color.White)
|
|
||||||
//whiteImage.Set(1, 1, color.White)
|
|
||||||
}
|
|
||||||
|
|
||||||
func segmentsToImage(a *glyphAtlas, segs []api.Segment, subpixelOffset fixed.Point26_6, glyphBounds fixed.Rectangle26_6) *atlas.Image {
|
func segmentsToImage(a *glyphAtlas, segs []api.Segment, subpixelOffset fixed.Point26_6, glyphBounds fixed.Rectangle26_6) *atlas.Image {
|
||||||
if len(segs) == 0 {
|
if len(segs) == 0 {
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user