[Bf-committers] Restored Text Undo.

joeedh joeeagar at prodigy.net
Wed Nov 10 01:45:15 CET 2004


Sortof.  Text undo is executed while the mouse is inside the text 
window, but theres still the problem with global undo messing up the 
text buffers if the cursor is outside the text window.

joeedh

-------------- next part --------------
Index: blender/source/blender/src/space.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/space.c,v
retrieving revision 1.201
diff -r1.201 space.c
73a74
> #include "DNA_text_types.h"
82a84,85
> #include "BKE_sca.h"
> #include "BKE_text.h"
630,645c633,651
< 	if(G.obedit) {
< 		if(G.obedit->type==OB_MESH)
< 			undo_push_mesh(str);
< 		else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
< 			undo_push_curve(str);
< 		else if (G.obedit->type==OB_FONT)
< 			undo_push_font(str);
< 		else if (G.obedit->type==OB_MBALL)
< 			undo_push_mball(str);
< 		else if (G.obedit->type==OB_LATTICE)
< 			undo_push_lattice(str);
< 	}
< 	else {
< 		if(U.uiflag & USER_GLOBALUNDO) 
< 			BKE_write_undo(str);
< 	}
---
>     /*text does it's undo automatically, so we don't need any undo pushes*/
>     if (curarea->spacetype != SPACE_TEXT) {
> 		if(G.obedit) {
> 			if(G.obedit->type==OB_MESH)
> 				undo_push_mesh(str);
> 			else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
> 				undo_push_curve(str);
> 			else if (G.obedit->type==OB_FONT)
> 				undo_push_font(str);
> 			else if (G.obedit->type==OB_MBALL)
> 				undo_push_mball(str);
> 			else if (G.obedit->type==OB_LATTICE)
> 				undo_push_lattice(str);
> 		}
> 		else {
> 			if(U.uiflag & USER_GLOBALUNDO) 
> 				BKE_write_undo(str);
> 		}    
> 	}		
650,658c656,660
< 	if(G.obedit) {
< 		if ELEM6(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE)
< 			undo_editmode_step(1);
< 	}
< 	else {
< 		if(G.f & G_WEIGHTPAINT)
< 			wpaint_undo();
< 		else if(G.f & G_VERTEXPAINT)
< 			vpaint_undo();
---
>     if (curarea->spacetype != SPACE_TEXT) {
> 		if(G.obedit) {
> 			if ELEM6(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE)
> 				undo_editmode_step(1);
> 		}
660,661c662,669
< 			/* now also in faceselect mode */
< 			if(U.uiflag & USER_GLOBALUNDO) BKE_undo_step(1);
---
> 			if(G.f & G_WEIGHTPAINT)
> 				wpaint_undo();
> 			else if(G.f & G_VERTEXPAINT)
> 				vpaint_undo();
> 			else {
> 				/* now also in faceselect mode */
> 				if(U.uiflag & USER_GLOBALUNDO) BKE_undo_step(1);
> 			}
663c671,676
< 	}
---
> 	} else {
> 	    SpaceText *st= curarea->spacedata.first;
> 		Text *text= st->text;
> 		txt_do_undo(text);
> 		allqueue(REDRAWTEXT, 1);
> 	}    
668,676c681,685
< 	if(G.obedit) {
< 		if ELEM6(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE)
< 			undo_editmode_step(-1);
< 	}
< 	else {
< 		if(G.f & G_WEIGHTPAINT)
< 			wpaint_undo();
< 		else if(G.f & G_VERTEXPAINT)
< 			vpaint_undo();
---
>     if (curarea->spacetype != SPACE_TEXT) {
> 		if(G.obedit) {
> 			if ELEM6(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE)
> 				undo_editmode_step(-1);
> 		}
678,679c687,694
< 			/* includes faceselect now */
< 			if(U.uiflag & USER_GLOBALUNDO) BKE_undo_step(-1);
---
> 			if(G.f & G_WEIGHTPAINT)
> 				wpaint_undo();
> 			else if(G.f & G_VERTEXPAINT)
> 				vpaint_undo();
> 			else {
> 				/* includes faceselect now */
> 				if(U.uiflag & USER_GLOBALUNDO) BKE_undo_step(-1);
> 			}
681c696,701
< 	}
---
> 	} else {
> 		SpaceText *st= curarea->spacedata.first;
> 		Text *text= st->text;
> 		txt_do_redo(text);
> 		allqueue(REDRAWTEXT, 1);
>  	}    		


More information about the Bf-committers mailing list