drawtext: export uiDrawTextLayoutExtents as DrawTextLayout.Extents

This commit is contained in:
Anthony Romano 2019-01-06 13:43:37 -08:00
parent 867a9e5a49
commit 468ea796b0
1 changed files with 6 additions and 1 deletions

View File

@ -504,9 +504,14 @@ func (tl *DrawTextLayout) Free() {
C.uiDrawFreeTextLayout(tl.tl)
}
// Extents returns the width and height of the tl.
func (tl *DrawTextLayout) Extents() (width, height float64) {
C.uiDrawTextLayoutExtents(tl.tl, (*C.double)(&width), (*C.double)(&height))
return width, height
}
// Text draws tl in c with the top-left point of tl at (x, y).
func (c *DrawContext) Text(tl *DrawTextLayout, x, y float64) {
C.uiDrawText(c.c, tl.tl, C.double(x), C.double(y))
}
// TODO uiDrawTextLayoutExtents