fixed two errors in events for knife tool:

- ESC for pupmenu was not handled
- pressing ENTER at pupmenu caused mousetrail call to exit
This commit is contained in:
2003-11-12 22:20:27 +00:00
parent 3e972a57e9
commit c51180b860
2 changed files with 29 additions and 20 deletions

View File

@@ -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) ){
event=extern_qread(&val); /* Enter or RMB indicates finish */
while(TRUE) {
if ((event==ESCKEY)||(event==RIGHTMOUSE)){
event=extern_qread(&val); /* Enter or RMB indicates finish */
if(val) {
if(event==RETKEY || event==PADENTER) break;
}
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();
@@ -7665,7 +7673,7 @@ void undo_clear_mesh(void)
void undo_menu_mesh(void)
{
short event=66;
int i, lasti;
int i;
char menu[2080], temp[64];
TEST_EDITMESH

View File

@@ -3890,6 +3890,7 @@ short pupmenu(char *instr)
y1= starty + boxh*(md->nitems-1);
x1= startx;
for(a=0; a<md->nitems; a++) {
char *name= md->items[a].str;