refactor: 调整 LastDiffToImage 函数中的背景图大小和位置,增加边距以改善图像布局效果
This commit is contained in:
parent
5bf7d65ce8
commit
8e29152d6d
@ -622,13 +622,13 @@ func (p PlayerDataLite) LastDiffToImage(lastDayQueryData PlayerDataLite) string
|
||||
totalWidth := maxX - minX
|
||||
totalHeight := maxY - minY
|
||||
|
||||
background := image.NewRGBA(image.Rect(0, 0, int(totalWidth), int(totalHeight)))
|
||||
background := image.NewRGBA(image.Rect(0, 0, int(totalWidth+10), int(totalHeight+10)))
|
||||
draw.Draw(background, background.Bounds(), image.White, image.Point{}, draw.Src)
|
||||
backgroundSpirit := sprite.Sprite{
|
||||
Name: "background",
|
||||
Image: background,
|
||||
Index: 0,
|
||||
Position: image.Point{X: minX, Y: minY},
|
||||
Position: image.Point{X: minX - 5, Y: minY - 5},
|
||||
}
|
||||
baseboard.AddSprite(&backgroundSpirit)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user