Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2003-11-13 01:20:27 +0300
committerTon Roosendaal <ton@blender.org>2003-11-13 01:20:27 +0300
commitc51180b860c061b0411cefb851d6fb4a7fd22265 (patch)
treeb1e4e466e94b6945fb79361aabe76ec540f1fcd3 /source/blender/src/editmesh.c
parent3e972a57e9494c94d29017fb5aacee04cc854f93 (diff)
fixed two errors in events for knife tool:
- ESC for pupmenu was not handled - pressing ENTER at pupmenu caused mousetrail call to exit
Diffstat (limited to 'source/blender/src/editmesh.c')
-rw-r--r--source/blender/src/editmesh.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/source/blender/src/editmesh.c b/source/blender/src/editmesh.c
index 1525c69125a..52033a02a07 100644
--- a/source/blender/src/editmesh.c
+++ b/source/blender/src/editmesh.c
@@ -7234,11 +7234,14 @@ CutCurve *get_mouse_trail(int *len, char mode){
glColor3ub(200, 200, 0);
- event=extern_qread(&val);
- while((event != RETKEY ) && (event != PADENTER ) && (event != RIGHTMOUSE) ){
+ while(TRUE) {
+
event=extern_qread(&val); /* Enter or RMB indicates finish */
+ if(val) {
+ if(event==RETKEY || event==PADENTER) break;
+ }
- if ((event==ESCKEY)||(event==RIGHTMOUSE)){
+ if( event==ESCKEY || event==RIGHTMOUSE ) {
if (curve) MEM_freeN(curve);
*len=0;
glFinish();
@@ -7367,10 +7370,15 @@ void KnifeSubdivide(char mode){
if (G.obedit==0) return;
+ if (mode==KNIFE_PROMPT) {
+ short val= pupmenu("Cut Type %t|Exact Line%x1|Midpoints%x2");
+ if(val<1) return;
+ mode= val; // warning, mode is char, pupmenu returns -1 with ESC
+ }
+
undo_push_mesh("Knife");
calc_meshverts_ext(); /*Update screen coords for current window */
- if (mode==KNIFE_PROMPT) mode=pupmenu("Cut Type %t|Exact Line%x1|Midpoints%x2|");
/* Set a knife cursor here */
oldcursor=get_cursor();
@@ -7664,24 +7672,24 @@ void undo_clear_mesh(void)
void undo_menu_mesh(void)
{
- short event=66;
- int i, lasti;
- char menu[2080], temp[64];
-
- TEST_EDITMESH
-
- strcpy(menu, "UNDO %t|%l");
- strcat(menu, "|All changes%x1|%l");
-
- for (i=G.undo_edit_level; i>=0; i--) {
- snprintf(temp, 64, "|%s%%x%d", G.undo_edit[i].name, i+2);
- strcat(menu, temp);
- }
+ short event=66;
+ int i;
+ char menu[2080], temp[64];
- event=pupmenu_col(menu, 20);
+ TEST_EDITMESH
+
+ strcpy(menu, "UNDO %t|%l");
+ strcat(menu, "|All changes%x1|%l");
+
+ for (i=G.undo_edit_level; i>=0; i--) {
+ snprintf(temp, 64, "|%s%%x%d", G.undo_edit[i].name, i+2);
+ strcat(menu, temp);
+ }
+
+ event=pupmenu_col(menu, 20);
- if(event<1) return;
+ if(event<1) return;
- if (event==1) remake_editMesh();
- else undo_pop_mesh(G.undo_edit_level-event+3);
+ if (event==1) remake_editMesh();
+ else undo_pop_mesh(G.undo_edit_level-event+3);
}