fogleman / gg

Go Graphics - 2D rendering in Go with a simple API.
https://godoc.org/github.com/fogleman/gg
MIT License
4.34k stars 352 forks source link

DrawStringWrapped draws text with offset comparing to DrawStringAnchored #198

Open gatilisk opened 2 months ago

gatilisk commented 2 months ago

DrawStringWrapped draws text at one line Y offset.

text := "hello world" x := 10 y := 10 ax := 0 ay := 0 DrawStringAnchored(dc, text, x, y, ax, ay, .... DrawStringWrapped(dc, text, x, y, ax, ay, ....

The coordinates are the same, but the text position is not the same.

DrawStringWrapped with ay = 0 eventually calls DrawStringAnchored with ay = 1