Skip to content

Commit

Permalink
fix: score
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Nov 20, 2023
1 parent 6f2019e commit 0910dc6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin/score/draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func floatstyle(a *scoredata) (img image.Image, err error) {
}()

wg.Wait()
if scbackimg == nil || backshadowimg == nil || avatarimg == nil || avatarbackimg == nil || avatarshadowimg == nil || whitetext == nil || blacktext == nil {
if scbackimg == nil || backshadowimg == nil || avatarbackimg == nil || avatarshadowimg == nil || whitetext == nil || blacktext == nil {
err = errors.New("图片渲染失败")
return
}
Expand All @@ -157,7 +157,9 @@ func floatstyle(a *scoredata) (img image.Image, err error) {

canvas.DrawImage(avatarshadowimg, 0, 0)
canvas.DrawImage(avatarbackimg, 0, 0)
canvas.DrawImageAnchored(avatarimg, int((ch-sch)/2/2), int((ch-sch)/2/2), 0.5, 0.5)
if avatarimg != nil {
canvas.DrawImageAnchored(avatarimg, int((ch-sch)/2/2), int((ch-sch)/2/2), 0.5, 0.5)
}

canvas.DrawImage(blacktext, 2, 2)
canvas.DrawImage(whitetext, 0, 0)
Expand Down

0 comments on commit 0910dc6

Please sign in to comment.