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

Method UpdateCaretPosition

src/textbuf.cpp:304–308  ·  view source on GitHub ↗

Update pixel position of the caret. */

Source from the content-addressed store, hash-verified

302
303/** Update pixel position of the caret. */
304void Textbuf::UpdateCaretPosition()
305{
306 const auto pos = GetCharPosInString(this->buf, this->caretpos, FS_NORMAL);
307 this->caretxoffs = _current_text_dir == TD_LTR ? pos.left : pos.right;
308}
309
310/** Update pixel positions of the marked text area. */
311void Textbuf::UpdateMarkedText()

Callers 8

DeleteCharMethod · 0.95
InsertCharMethod · 0.95
InsertStringMethod · 0.95
DeleteTextMethod · 0.95
MovePrevMethod · 0.95
MoveNextMethod · 0.95
MovePosMethod · 0.95
UpdateSizeMethod · 0.95

Calls 1

GetCharPosInStringFunction · 0.85

Tested by

no test coverage detected