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 0614e18 commit 6929ac9
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 @@ -143,7 +143,7 @@ func drawText(c *freetype.Context, font *truetype.Font, text string, width int)
// スケールに基づいてフォントサイズを調整
c.SetFontSize(lineHeight * scale)
// テキストを中央揃えで描画するための開始ポイントを計算
pt := freetype.Pt(int(math.Round((float64(CANVAS_WIDTH)-(float64(txtWidth)*scale))/2)), i*int(lineHeight)+int(lineHeight*scale))
pt := freetype.Pt(int(math.Round((float64(CANVAS_WIDTH)-(float64(txtWidth)*scale))/2)), i*int(lineHeight)+int(lineHeight*scale+lineHeight*(1-scale)/2))
_, err := c.DrawString(line, pt)
if err != nil {
return err
Expand Down

0 comments on commit 6929ac9

Please sign in to comment.