From 49d54d7582bdcbdcff5637e72e9f29bb5cc571bd Mon Sep 17 00:00:00 2001 From: epoch Date: Thu, 10 Mar 2022 15:05:32 +0000 Subject: added a sanity check --- src/graphics_c2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/graphics_c2.c b/src/graphics_c2.c index c4c9193..571075a 100644 --- a/src/graphics_c2.c +++ b/src/graphics_c2.c @@ -1,4 +1,6 @@ #include "common.h" +#include //free() +#include //strdup() #include "math.h" #include "graphics_cs.h" #include "graphics_c3.h" @@ -39,6 +41,15 @@ void draw_c2_shape(c2_s_t s) { // if(cn_PnPoly(gra_global.mouse,s.p,s.len+(s.len==1))) {//if the mouse is inside the shape, we're going to draw a different outline. if(epoch_PnPoly(gra_global.mouse,s.p,s.len+(s.len==1))) {//if the mouse is inside the shape, we're going to draw a different outline. set_ansi_color(7); + if(!s.id || !global.active) printf("# ERROR. shape is midding id.\n"); + else { + if(strcmp(s.id,global.active)) {//we need to update the moused-over +// free(global.active); + global.active=strdup(s.id); + printf("%s active %s\n",global.user,global.active); +// set_title(global.active); + } + } if(gra_global.mousemap[MOUSE_PRIMARY]==1) { printf("%s action %s\n",global.user,s.id); gra_global.mousemap[MOUSE_PRIMARY]=0; -- cgit v1.2.3