Skip to content

Commit

Permalink
Avoid unnecessary conversion
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Muehlhaeuser <[email protected]>
  • Loading branch information
muesli committed May 27, 2021
1 parent c4cdf90 commit 68e1d79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func drawString(img *image.RGBA, bounds image.Rectangle, ttf *truetype.Font, tex
pt = image.Pt(int(xcenter), pt.Y)
}
if pt.Y < 0 {
actheight := int(float64(fontsize) * 72.0 / float64(dev.DPI))
actheight := int(fontsize * 72.0 / float64(dev.DPI))
ycenter := float64(bounds.Dy()/2.0) + float64(actheight)
pt = image.Pt(pt.X, bounds.Min.Y+int(ycenter))
}
Expand Down

0 comments on commit 68e1d79

Please sign in to comment.