Skip to content

Commit

Permalink
up: vertical-position-of-text ^^
Browse files Browse the repository at this point in the history
  • Loading branch information
taniiicom committed Apr 24, 2024
1 parent 5d27bca commit 781ac54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/domain/TextEmoji/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func drawText(c *freetype.Context, font *truetype.Font, text string, width int)
// スケールに基づいてフォントサイズを調整
c.SetFontSize(fontSize * scale)
// テキストを中央揃えで描画するための開始ポイントを計算
pt := freetype.Pt(int(math.Round((float64(CANVAS_WIDTH)-(float64(txtWidth)*scale))/2)), int(yPos)+i*int(fontSize))
pt := freetype.Pt(int(math.Round((float64(CANVAS_WIDTH)-(float64(txtWidth)*scale))/2)), int(yPos)+i*int(fontSize*scale))
_, err := c.DrawString(line, pt)
if err != nil {
return err
Expand Down

0 comments on commit 781ac54

Please sign in to comment.