[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51745] trunk/blender/source/blender/ editors/curve/editfont.c: Bugfix:

Ton Roosendaal ton at blender.org
Mon Oct 29 20:18:15 CET 2012


Revision: 51745
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51745
Author:   ton
Date:     2012-10-29 19:18:13 +0000 (Mon, 29 Oct 2012)
Log Message:
-----------
Bugfix:

3D text object editing, ALT+Backspace trick is back to construct special characters.
Like: O , Alt+Backspace , /  creates an O with a / in it.

It also makes plus-minus, unequal, copyright, 1/2, 3/4. etc. Easy method you 
never forget after using once!

Got broken with adding UTF support a year ago.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/curve/editfont.c

Modified: trunk/blender/source/blender/editors/curve/editfont.c
===================================================================
--- trunk/blender/source/blender/editors/curve/editfont.c	2012-10-29 18:25:35 UTC (rev 51744)
+++ trunk/blender/source/blender/editors/curve/editfont.c	2012-10-29 19:18:13 UTC (rev 51745)
@@ -1251,8 +1251,12 @@
 		else
 			ascii = 9;
 	}
-	else if (event == BACKSPACEKEY)
-		ascii = 0;
+	
+	if (event == BACKSPACEKEY) {
+		if (alt && cu->len != 0 && cu->pos > 0)
+			accentcode = 1;
+		return OPERATOR_PASS_THROUGH;
+	}
 
 	if (val && (ascii || evt->utf8_buf[0])) {
 		/* handle case like TAB (== 9) */
@@ -1263,19 +1267,19 @@
 		         (evt->utf8_buf[0]))
 		{
 
-			if (evt->utf8_buf[0]) {
-				BLI_strncpy_wchar_from_utf8(inserted_text, evt->utf8_buf, 1);
-				ascii = inserted_text[0];
-				insert_into_textbuf(obedit, ascii);
-				accentcode = 0;
-			}
-			else if (accentcode) {
+			if (accentcode) {
 				if (cu->pos > 0) {
 					inserted_text[0] = findaccent(ef->textbuf[cu->pos - 1], ascii);
 					ef->textbuf[cu->pos - 1] = inserted_text[0];
 				}
 				accentcode = 0;
 			}
+			else if (evt->utf8_buf[0]) {
+				BLI_strncpy_wchar_from_utf8(inserted_text, evt->utf8_buf, 1);
+				ascii = inserted_text[0];
+				insert_into_textbuf(obedit, ascii);
+				accentcode = 0;
+			}
 			else if (cu->len < MAXTEXT - 1) {
 				if (alt) {
 					/* might become obsolete, apple has default values for this, other OS's too? */
@@ -1312,12 +1316,6 @@
 			text_update_edited(C, scene, obedit, 1, FO_EDIT);
 		}
 	}
-	else if (val && event == BACKSPACEKEY) {
-		if (alt && cu->len != 0 && cu->pos > 0)
-			accentcode = 1;
-
-		return OPERATOR_PASS_THROUGH;
-	}
 	else
 		return OPERATOR_PASS_THROUGH;
 
@@ -1330,7 +1328,8 @@
 	}
 
 	/* reset property? */
-	accentcode = 0;
+	if (val == 0)
+		accentcode = 0;
 	
 	return OPERATOR_FINISHED;
 }




More information about the Bf-blender-cvs mailing list