chore: 更新 go.mod 和 go.sum 文件,添加新的依赖项并移除旧版本的 imagedd 依赖
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"image/color"
|
||||
"image/draw"
|
||||
"log"
|
||||
"math"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -619,15 +618,17 @@ func (p PlayerDataLite) LastDiffToImage(lastDayQueryData PlayerDataLite) string
|
||||
}
|
||||
baseboard.AddSprite(&textSpirit)
|
||||
|
||||
totalWidth := textImg.Bounds().Dx() + avatar.Bounds().Dx()
|
||||
totalHeight := math.Max(float64(textImg.Bounds().Dy()), float64(avatar.Bounds().Dy()))
|
||||
minX, minY, maxX, maxY := baseboard.GetRenderBounds()
|
||||
totalWidth := maxX - minX
|
||||
totalHeight := maxY - minY
|
||||
|
||||
background := image.NewRGBA(image.Rect(0, 0, int(totalWidth), int(totalHeight)))
|
||||
draw.Draw(background, background.Bounds(), image.White, image.Point{}, draw.Src)
|
||||
backgroundSpirit := sprite.Sprite{
|
||||
Name: "background",
|
||||
Image: background,
|
||||
Index: 0,
|
||||
Name: "background",
|
||||
Image: background,
|
||||
Index: 0,
|
||||
Position: image.Point{X: minX, Y: minY},
|
||||
}
|
||||
baseboard.AddSprite(&backgroundSpirit)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user