package ui import ( "image" ) func centerTextXOffset(b image.Rectangle) int { return (b.Dx() / 2) - b.Min.X } func centerTextYOffset(b image.Rectangle) int { return (b.Dy() / 2) + b.Min.Y } func centerText(b image.Rectangle) (x int, y int) { x = centerTextXOffset(b) y = centerTextYOffset(b) return }