]> granicus.if.org Git - graphviz/commitdiff
Having bool != char is catching some real bugs!
authorellson <devnull@localhost>
Sun, 29 Jan 2006 23:34:31 +0000 (23:34 +0000)
committerellson <devnull@localhost>
Sun, 29 Jan 2006 23:34:31 +0000 (23:34 +0000)
lib/gvc/gvcjob.h
lib/gvc/gvevent.c

index af627bb72f0bcbf2c9ef64a24517a73246f3189f..ae13e9f5819de383b36c185053a8b1a2e0384a42 100644 (file)
@@ -192,10 +192,10 @@ extern "C" {
        bool    fit_mode,
                needs_refresh,
                click,
-               active,
                has_grown,
                has_been_rendered;
 
+       unsigned char button;   /* active button */
        pointf pointer;         /* pointer position in device units */
        pointf oldpointer;      /* old pointer position in device units */
 
index 330726b73dc209e8b89182f6681e03accf62e993..b6597897f3a41b254b15b235e98749e4b40c7881 100644 (file)
@@ -384,18 +384,18 @@ static void gvevent_button_press(GVJ_t * job, int button, pointf pointer)
        gvevent_find_current_obj(job, pointer);
        gvevent_select_current_obj(job);
         job->click = 1;
-       job->active = button;
+       job->button = button;
        job->needs_refresh = 1;
        break;
     case 2: /* pan */
         job->click = 1;
-       job->active = button;
+       job->button = button;
        job->needs_refresh = 1;
        break;
     case 3: /* insert node or edge */
        gvevent_find_current_obj(job, pointer);
         job->click = 1;
-       job->active = button;
+       job->button = button;
        job->needs_refresh = 1;
        break;
     case 4:
@@ -424,7 +424,7 @@ static void gvevent_button_press(GVJ_t * job, int button, pointf pointer)
 static void gvevent_button_release(GVJ_t *job, int button, pointf pointer)
 {
     job->click = 0;
-    job->active = 0;
+    job->button = 0;
 }
 
 static void gvevent_motion(GVJ_t * job, pointf pointer)
@@ -435,7 +435,7 @@ static void gvevent_motion(GVJ_t * job, pointf pointer)
     if (abs(dx) < EPSILON && abs(dy) < EPSILON)  /* ignore motion events with no motion */
        return;
 
-    switch (job->active) {
+    switch (job->button) {
     case 0: /* drag with no button - */
        gvevent_find_current_obj(job, pointer);
        break;