diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-12 08:54:15 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-12 08:54:15 +0300 |
commit | 629bfd2a315c1e6227342769e891d9642adbace7 (patch) | |
tree | c3abac9c81735704bac99e76f5110d8cb999584c /source/blender/editors | |
parent | 6f79716326d0daab8b83b9b9701920bf3146211b (diff) |
Fix [#19922] outliner+renaming+shift+home
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 418773cbe25..6c78a1f2a11 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -904,19 +904,23 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b if(but->editstr && but->pos != -1) { short t=0, pos=0, ch; short selsta_tmp, selend_tmp, selsta_draw, selwidth_draw; - + if ((but->selend - but->selsta) > 0) { /* text button selection */ selsta_tmp = but->selsta; selend_tmp = but->selend; if(but->drawstr[0]!=0) { - ch= but->drawstr[selsta_tmp]; - but->drawstr[selsta_tmp]= 0; - - selsta_draw = BLF_width(but->drawstr+but->ofs); - - but->drawstr[selsta_tmp]= ch; + + if (but->selsta >= but->ofs) { + ch= but->drawstr[selsta_tmp]; + but->drawstr[selsta_tmp]= 0; + + selsta_draw = BLF_width(but->drawstr+but->ofs); + + but->drawstr[selsta_tmp]= ch; + } else + selsta_draw = 0; ch= but->drawstr[selend_tmp]; but->drawstr[selend_tmp]= 0; |