Document that Clear resets the Dot to Orig

Remove note on how to reset Dot to the Orig
This commit is contained in:
Peter Hellberg 2018-01-19 23:00:33 +01:00
parent ad738cddf8
commit 8d8d5cc9db
1 changed files with 2 additions and 5 deletions

View File

@ -61,10 +61,7 @@ func RangeTable(table *unicode.RangeTable) []rune {
// Text exports two important fields: Orig and Dot. Dot is the position where the next character
// will be written. Dot is automatically moved when writing to a Text object, but you can also
// manipulate it manually. Orig specifies the text origin, usually the top-left dot position. Dot is
// always aligned to Orig when writing newlines.
//
// To reset the Dot to the Orig, just assign it:
// txt.Dot = txt.Orig
// always aligned to Orig when writing newlines. The Clear method resets the Dot to Orig.
type Text struct {
// Orig specifies the text origin, usually the top-left dot position. Dot is always aligned
// to Orig when writing newlines.
@ -184,7 +181,7 @@ func (txt *Text) BoundsOf(s string) pixel.Rect {
return bounds
}
// Clear removes all written text from the Text.
// Clear removes all written text from the Text. The Dot field is reset to Orig.
func (txt *Text) Clear() {
txt.prevR = -1
txt.bounds = pixel.Rect{}