Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion drawtext.go
Original file line number Diff line number Diff line change
Expand Up @@ -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