[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43724] trunk/blender/source/blender/ editors/interface: Fix #29958: Search Menu keeps hiding first character(s) after long input

Sergey Sharybin sergey.vfx at gmail.com
Thu Jan 26 13:48:43 CET 2012


Revision: 43724
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43724
Author:   nazgul
Date:     2012-01-26 12:48:36 +0000 (Thu, 26 Jan 2012)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/editors/interface/interface_widgets.c

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2012-01-26 12:44:31 UTC (rev 43723)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2012-01-26 12:48:36 UTC (rev 43724)
@@ -1527,6 +1527,8 @@
 	const int pos_prev= but->pos;
 	const int has_sel= (but->selend - but->selsta) > 0;
 
+	ui_check_but(but);
+
 	/* special case, quit selection and set cursor */
 	if (has_sel && !select) {
 		if (jump == BUTTON_EDIT_JUMP_ALL) {

Modified: trunk/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_widgets.c	2012-01-26 12:44:31 UTC (rev 43723)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c	2012-01-26 12:48:36 UTC (rev 43724)
@@ -952,6 +952,9 @@
 	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;
 	



More information about the Bf-blender-cvs mailing list