[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15839] branches/soc-2008-quorn/source/ blender: Draw cursor at the leading edge of selection (as in other apps.) and hide cursor swapping from the user.

Ian Thompson quornian at googlemail.com
Mon Jul 28 13:54:13 CEST 2008


Revision: 15839
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15839
Author:   quorn
Date:     2008-07-28 13:54:13 +0200 (Mon, 28 Jul 2008)

Log Message:
-----------
Draw cursor at the leading edge of selection (as in other apps.) and hide cursor swapping from the user.

Modified Paths:
--------------
    branches/soc-2008-quorn/source/blender/blenkernel/intern/text.c
    branches/soc-2008-quorn/source/blender/src/drawtext.c

Modified: branches/soc-2008-quorn/source/blender/blenkernel/intern/text.c
===================================================================
--- branches/soc-2008-quorn/source/blender/blenkernel/intern/text.c	2008-07-28 11:30:04 UTC (rev 15838)
+++ branches/soc-2008-quorn/source/blender/blenkernel/intern/text.c	2008-07-28 11:54:13 UTC (rev 15839)
@@ -1712,7 +1712,6 @@
 
 		case UNDO_SWAP:
 			txt_curs_swap(text);
-			txt_do_undo(text); /* swaps should appear transparent */
 			break;
 
 		case UNDO_DBLOCK:
@@ -1829,9 +1828,16 @@
 	}
 
 	/* next undo step may need evaluating */
-	if (text->undo_pos>=0 && text->undo_buf[text->undo_pos] == UNDO_STO) {
-		txt_do_undo(text);
-		txt_do_redo(text); /* selections need restoring */
+	if (text->undo_pos>=0) {
+		switch (text->undo_buf[text->undo_pos]) {
+			case UNDO_STO:
+				txt_do_undo(text);
+				txt_do_redo(text); /* selections need restoring */
+				break;
+			case UNDO_SWAP:
+				txt_do_undo(text); /* swaps should appear transparent */
+				break;
+		}
 	}
 	
 	undoing= 0;	

Modified: branches/soc-2008-quorn/source/blender/src/drawtext.c
===================================================================
--- branches/soc-2008-quorn/source/blender/src/drawtext.c	2008-07-28 11:30:04 UTC (rev 15838)
+++ branches/soc-2008-quorn/source/blender/src/drawtext.c	2008-07-28 11:54:13 UTC (rev 15839)
@@ -695,17 +695,17 @@
 
 	}
 
-	/* Draw the cursor itself */
-	x= text_draw(st, text->curl->line, st->left, text->curc, 0, 0, 0, NULL);
+	/* Draw the cursor itself (we draw the sel. cursor as this is the leading edge) */
+	x= text_draw(st, text->sell->line, st->left, text->selc, 0, 0, 0, NULL);
 	
 	if (x) {
 		offl= offc= 0;
-		if (st->wordwrap) wrap_offset(st, text->curl, text->curc, &offl, &offc);
+		if (st->wordwrap) wrap_offset(st, text->sell, text->selc, &offl, &offc);
 		x += offc*spacetext_get_fontwidth(st);
-		h= txt_get_span(text->lines.first, text->curl) - st->top + offl;
+		h= txt_get_span(text->lines.first, text->sell) - st->top + offl;
 
 		if (st->overwrite) {
-			ch[0]= (unsigned char) text->curl->line[text->curc];
+			ch[0]= (unsigned char) text->sell->line[text->selc];
 			if (ch[0]=='\0') ch[0]=' ';
 			ch[1]= '\0';
 			w= BMF_GetStringWidth(spacetext_get_font(st), ch);





More information about the Bf-blender-cvs mailing list