Fix #29958: Search Menu keeps hiding first character(s) after long input

- ui_check_but() in ui_textedit_move() is necessary because this function clips
  but->drawstring to fit text entry widget and it confuses cursor movement stuff.
  ui_check_but copies editstring to drawstring, so displaystring would be clipped
  again in correct way.
- If the whole drawstring fits widget, no need to set button's offset.
This commit is contained in:
2012-01-26 12:48:36 +00:00
parent 83a6b331a7
commit 4ae93a48d8
2 changed files with 5 additions and 0 deletions

View File

@@ -952,6 +952,9 @@ static void ui_text_leftclip(uiFontStyle *fstyle, uiBut *but, rcti *rect)
if(but->editstr && but->pos >= 0) {
if(but->ofs > but->pos)
but->ofs= but->pos;
if(BLF_width(fstyle->uifont_id, but->drawstr) <= okwidth)
but->ofs = 0;
}
else but->ofs= 0;