コード例 #1
0
ファイル: demo.go プロジェクト: dushmis/hilbert
func (h *HilbertImage) drawText(gc *draw2d.ImageGraphicContext, px1, py1 float64, t int) {
	if !h.DrawText {
		return
	}

	text := strconv.Itoa(t)
	_, top, _, _ := gc.GetStringBounds(text)

	gc.SetFillColor(h.TextColor)
	gc.FillStringAt(text, px1+h.TextMargin, py1-top+h.TextMargin)
}