Textbutton: SHIFT+Arrow selections did not work proper when the amount of
text in a button was more than its width could display. Now still doesn't
work OK 100% (when selection itself goes outside of button view).

Also: removed the very bad SELWIDTH define (but->selend - but->selsta).
That's not making readable code!
This commit is contained in:
2006-12-26 10:18:38 +00:00
parent e4511c805f
commit d109129663
3 changed files with 10 additions and 13 deletions

View File

@@ -1464,12 +1464,10 @@ static void ui_draw_text_icon(uiBut *but)
/* text button selection and cursor */
if(but->pos != -1) {
if (SELWIDTH > 0) {
if ((but->selend - but->selsta) > 0) {
/* text button selection */
selsta_tmp = but->selsta + strlen(but->str);
selend_tmp = but->selend + strlen(but->str);
if (but->ofs >= strlen(but->str))
selsta_tmp += (but->ofs - strlen(but->str));
if(but->drawstr[0]!=0) {
ch= but->drawstr[selsta_tmp];