All pastes #252395 Raw Edit

Someone

public text v1 · immutable
#252395 ·published 2006-11-19 13:18 UTC
rendered paste body
Index: group.c
===================================================================
--- group.c     (Revision 1292)
+++ group.c     (Arbeitskopie)
@@ -76,10 +76,10 @@
 #define GROUP_BRIGHTNESS_MIN             0
 #define GROUP_BRIGHTNESS_MAX             100
 
-#define GROUP_EXACTNESS_DEFAULT         1.0f
-#define GROUP_EXACTNESS_MIN             1.0f
-#define GROUP_EXACTNESS_MAX             100.0f
-#define GROUP_EXACTNESS_PRECISION              0.5f
+#define GROUP_TOLERANCE_DEFAULT         0.0f
+#define GROUP_TOLERANCE_MIN             0.0f
+#define GROUP_TOLERANCE_MAX             1.0f
+#define GROUP_TOLERANCE_PRECISION      0.01f
 
 #define GROUP_MOVE_DEFAULT               TRUE
 #define GROUP_RESIZE_DEFAULT             TRUE
@@ -114,7 +114,7 @@
 #define GROUP_SCREEN_OPTION_SELECTION_MODE             10
 #define GROUP_SCREEN_OPTION_SELECTION_COLOR            11
 #define GROUP_SCREEN_OPTION_LINE_COLOR                 12
-#define GROUP_SCREEN_OPTION_EXACTNESS                  13
+#define GROUP_SCREEN_OPTION_TOLERANCE                  13
 #define GROUP_SCREEN_OPTION_NUM                                        14
 
 /*
@@ -277,7 +277,7 @@
 {
        GROUP_SCREEN(s);
 
-       int exact = gs->opt[GROUP_SCREEN_OPTION_EXACTNESS].value.f;
+       float exact = gs->opt[GROUP_SCREEN_OPTION_TOLERANCE].value.f;
 
        Window *ret;
        int count = 0;
@@ -292,10 +292,10 @@
                        reg.extents.x2 > (WIN_X(w) + WIN_WIDTH(w)) &&
                        reg.extents.y2 > (WIN_Y(w) + WIN_HEIGHT(w))
                        */
-                       TOLRNC_MIN(reg.extents.x1, WIN_X (w), WIN_WIDTH  (w)/exact) &&
-                       TOLRNC_MIN(reg.extents.y1, WIN_Y (w), WIN_HEIGHT (w)/exact) &&
-                       TOLRNC_MAX(reg.extents.x2, (WIN_X (w) + WIN_WIDTH  (w)), WIN_WIDTH  (w)/exact) &&
-                       TOLRNC_MAX(reg.extents.y2, (WIN_Y (w) + WIN_HEIGHT (w)), WIN_HEIGHT (w)/exact))
+                       TOLRNC_MIN(reg.extents.x1, WIN_X (w), WIN_WIDTH (w) * exact) &&
+                       TOLRNC_MIN(reg.extents.y1, WIN_Y (w), WIN_HEIGHT (w) * exact) &&
+                       TOLRNC_MAX(reg.extents.x2, (WIN_X (w) + WIN_WIDTH (w)), WIN_WIDTH (w) * exact) &&
+                       TOLRNC_MAX(reg.extents.y2, (WIN_Y (w) + WIN_HEIGHT (w)), WIN_HEIGHT (w) * exact))
                {
                        if (count == 0) {
                                ret = calloc (1, sizeof (Window));
@@ -769,15 +769,15 @@
     o->value.c[2] = GROUP_COLOR_LINE_BLUE_DEFAULT;
     o->value.c[3] = GROUP_COLOR_LINE_ALPHA_DEFAULT;
 
-       o = &gs->opt[GROUP_SCREEN_OPTION_EXACTNESS];
-    o->name = "exactness";
-    o->shortDesc = N_("Exactness");
-    o->longDesc = N_("Exactness of the seletion.");
+       o = &gs->opt[GROUP_SCREEN_OPTION_TOLERANCE];
+    o->name = "selection_tolerance";
+    o->shortDesc = N_("Section tolerance");
+    o->longDesc = N_("Percentage of selection tolerance (amount of window size allowed to be outside the selection rectangle).");
     o->type = CompOptionTypeFloat;
-    o->value.f = GROUP_EXACTNESS_DEFAULT;
-    o->rest.f.min = GROUP_EXACTNESS_MIN;
-    o->rest.f.max = GROUP_EXACTNESS_MAX;
-       o->rest.f.precision = GROUP_EXACTNESS_PRECISION;
+    o->value.f = GROUP_TOLERANCE_DEFAULT;
+    o->rest.f.min = GROUP_TOLERANCE_MIN;
+    o->rest.f.max = GROUP_TOLERANCE_MAX;
+    o->rest.f.precision = GROUP_TOLERANCE_PRECISION;
 }
 
 /*
@@ -843,8 +843,8 @@
         }
         break;
 
-               case GROUP_SCREEN_OPTION_EXACTNESS:
-               if (compSetFloatOption (o, value))
+               case GROUP_SCREEN_OPTION_TOLERANCE:
+               if (compSetIntOption (o, value))
                {
                        return TRUE;
                }