From: handa Date: Mon, 12 Jul 2004 04:37:27 +0000 (+0000) Subject: (FeatureProc): Fix previous change. X-Git-Tag: REL-0-9-1~43 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=656e5bc94fffe9297717c137fb182d4b7505c8f8;p=m17n%2Flibotf.git (FeatureProc): Fix previous change. --- diff --git a/example/otfview.c b/example/otfview.c index b6bc94a..2ec484e 100644 --- a/example/otfview.c +++ b/example/otfview.c @@ -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 ();