(FeatureProc): Fix previous change.
authorhanda <handa>
Mon, 12 Jul 2004 04:37:27 +0000 (04:37 +0000)
committerhanda <handa>
Mon, 12 Jul 2004 04:37:27 +0000 (04:37 +0000)
example/otfview.c

index b6bc94a..2ec484e 100644 (file)
@@ -552,21 +552,21 @@ FeatureProc (OTF_FeatureList *list, FeatureRec *features, int idx)
     }
   else
     {
+      int index = features[idx].idx;
       i = idx;
-      idx = features[i].idx;
 
       if (features[i].on)
        {
          for (j = i; j + 1 < list->FeatureCount && features[j + 1].on; j++)
            features[j].idx = features[j + 1].idx;
-         features[j].idx = idx;
+         features[j].idx = index;
          features[j].on = 0;
        }
       else
        {
          for (j = i; i > 0 && ! features[i - 1].on; i--)
            features[i].idx = features[i - 1].idx;
-         features[i].idx = idx;
+         features[i].idx = index;
          features[i].on = 1;
        }
     }
@@ -574,19 +574,22 @@ FeatureProc (OTF_FeatureList *list, FeatureRec *features, int idx)
   for (; i <= j; i++)
     {
       char str[5];
+      unsigned fore = foreground, back = background;
 
-      OTF_tag_name (list->Feature[features[i].idx].FeatureTag, str);
-      XtSetArg (arg[0], XtNlabel, str);
+      if (i == idx)
+       fore = background, back = foreground;
       if (features[i].on)
        {
-         XtSetArg (arg[1], XtNforeground, background);
-         XtSetArg (arg[2], XtNbackground, foreground);
+         XtSetArg (arg[0], XtNforeground, back);
+         XtSetArg (arg[1], XtNbackground, fore);
        }
       else
        {
-         XtSetArg (arg[1], XtNforeground, foreground);
-         XtSetArg (arg[2], XtNbackground, background);
+         XtSetArg (arg[0], XtNforeground, fore);
+         XtSetArg (arg[1], XtNbackground, back);
        }
+      OTF_tag_name (list->Feature[features[i].idx].FeatureTag, str);
+      XtSetArg (arg[2], XtNlabel, str);
       XtSetValues (features[i].w, arg, 3);
     }
   update_seq_area ();