fogleman / gg

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

params of DrawStringWrapped() ax, ay means ambiguous #53

Open airylinus opened 6 years ago

airylinus commented 6 years ago

It's says:

The anchor point is x - w ax, y - h ay, where w, h is the size of the // text. Use ax=0.5, ay=0.5 to center the text at the specified point.

I'm not sure how to understanding the "anchor point", Does it the very central point ( both center of horizon and vertical ) of text area( or whole image?) ? Or the left top point of text area as OpenCV?

I noticed ax, ay coordinate with Align setting, but still cannt get it.

fogleman commented 5 years ago

Did you try rendering with different values to understand how it works?