This commit is contained in:
Anthony Romano 2020-06-20 17:13:04 +08:00 committed by GitHub
commit ca79f788b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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