MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / UpdateStringIter

Method UpdateStringIter

src/textbuf.cpp:290–295  ·  view source on GitHub ↗

Update the character iter after the text has changed. */

Source from the content-addressed store, hash-verified

288
289/** Update the character iter after the text has changed. */
290void Textbuf::UpdateStringIter()
291{
292 this->char_iter->SetString(this->buf);
293 size_t pos = this->char_iter->SetCurPosition(this->caretpos);
294 this->caretpos = pos == StringIterator::END ? 0 : (uint16_t)pos;
295}
296
297/** Update pixel width of the text. */
298void Textbuf::UpdateWidth()

Callers 6

DeleteCharMethod · 0.95
DeleteAllMethod · 0.95
InsertCharMethod · 0.95
InsertStringMethod · 0.95
DeleteTextMethod · 0.95
UpdateSizeMethod · 0.95

Calls 2

SetStringMethod · 0.45
SetCurPositionMethod · 0.45

Tested by

no test coverage detected