mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
all: rename sizeInPoints -> sizeInPixels
This commit is contained in:
parent
f2180a5dc5
commit
586a4b6d6e
@ -358,12 +358,12 @@ func (t *Tile) Draw(boardImage *ebiten.Image) {
|
||||
boardImage.DrawImage(tileImage, op)
|
||||
str := strconv.Itoa(v)
|
||||
|
||||
sizeInPoints := 48.0
|
||||
sizeInPixels := 48.0
|
||||
switch {
|
||||
case 3 < len(str):
|
||||
sizeInPoints = 24
|
||||
sizeInPixels = 24
|
||||
case 2 < len(str):
|
||||
sizeInPoints = 32
|
||||
sizeInPixels = 32
|
||||
}
|
||||
|
||||
textOp := &text.DrawOptions{}
|
||||
@ -373,6 +373,6 @@ func (t *Tile) Draw(boardImage *ebiten.Image) {
|
||||
textOp.SecondaryAlign = text.AlignCenter
|
||||
text.Draw(boardImage, str, &text.GoTextFace{
|
||||
Source: mplusFaceSource,
|
||||
SizeInPixels: sizeInPoints,
|
||||
SizeInPixels: sizeInPixels,
|
||||
}, textOp)
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ func (g *GoTextFace) outputCacheKey(text string) goTextOutputCacheKey {
|
||||
return goTextOutputCacheKey{
|
||||
text: text,
|
||||
direction: g.Direction,
|
||||
sizeInPoints: g.SizeInPixels,
|
||||
sizeInPixels: g.SizeInPixels,
|
||||
language: g.Language.String(),
|
||||
script: g.Script.String(),
|
||||
variations: g.ensureVariationsString(),
|
||||
|
@ -29,7 +29,7 @@ import (
|
||||
type goTextOutputCacheKey struct {
|
||||
text string
|
||||
direction Direction
|
||||
sizeInPoints float64
|
||||
sizeInPixels float64
|
||||
language string
|
||||
script string
|
||||
variations string
|
||||
@ -215,6 +215,6 @@ func (g *GoTextFaceSource) shape(text string, face *GoTextFace) (shaping.Output,
|
||||
return out, gs
|
||||
}
|
||||
|
||||
func (g *GoTextFaceSource) scale(sizeInPoints float64) float64 {
|
||||
return sizeInPoints / float64(g.f.Upem())
|
||||
func (g *GoTextFaceSource) scale(sizeInPixels float64) float64 {
|
||||
return sizeInPixels / float64(g.f.Upem())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user