From 8d8d5cc9dbdde363b30872418c453060310101d8 Mon Sep 17 00:00:00 2001 From: Peter Hellberg Date: Fri, 19 Jan 2018 23:00:33 +0100 Subject: [PATCH] Document that Clear resets the Dot to Orig Remove note on how to reset Dot to the Orig --- text/text.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/text/text.go b/text/text.go index fb66070..04354a6 100644 --- a/text/text.go +++ b/text/text.go @@ -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{}