summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/graphics_c2.c11
1 files changed, 11 insertions, 0 deletions
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 <stdlib.h> //free()
+#include <string.h> //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;