render-area tool sticky, cancel/redraw with esc
authorJohn Tsiombikas <nuclear@member.fsf.org>
Mon, 3 Jul 2023 11:03:09 +0000 (14:03 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Mon, 3 Jul 2023 11:03:09 +0000 (14:03 +0300)
src/app.c
src/scr_mod.c

index b0fc2e8..92759f6 100644 (file)
--- a/src/app.c
+++ b/src/app.c
@@ -202,9 +202,10 @@ void app_keyboard(int key, int press)
                        msec = get_msec();
                        if(msec - prev_esc < 1000) {
                                app_quit();
+                               return;
                        }
                        prev_esc = msec;
-                       return;
+                       break;
 #endif
 
                case 'q':
index b1cbc1d..ef1c920 100644 (file)
@@ -524,11 +524,12 @@ static void act_settool(int tidx)
        int i;
        rtk_rect r;
 
-       if(tidx == prev_tool) return;
+       if(tidx == cur_tool) return;
 
-       if(prev_tool == TOOL_REND_AREA) {
-               app_redisplay(totalrend.x, totalrend.y, totalrend.width, totalrend.height);
+       if(cur_tool == TOOL_REND_AREA) {
                totalrend.width = 0;
+               app_redisplay(totalrend.x, totalrend.y, totalrend.width, totalrend.height);
+               inval_vport();
        }
 
        prev_tool = cur_tool;