From c4b6399ce280d86cdb04c3209c3424940a36e0c8 Mon Sep 17 00:00:00 2001 From: handa Date: Mon, 26 Jul 2004 04:22:44 +0000 Subject: [PATCH] (visual_order): Fix previous change. (draw_background): Fix bar cursor position on a r2l glyph. --- src/draw.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/draw.c b/src/draw.c index b143781..070c8de 100644 --- a/src/draw.c +++ b/src/draw.c @@ -142,14 +142,14 @@ visual_order (MGlyphString *gstring) fribidi_log2vis (logical, len, &base, visual, indices, NULL, levels); #else /* not HAVE_FRIBIDI */ - indices = alloca (sizeof (int) * size); - for (i = 0; i < size; i++) + indices = alloca (sizeof (int) * len); + for (i = 0; i < len; i++) { if (levels[i]) { int j, k; - for (j = i + 1; j < size && levels[j]; j++); + for (j = i + 1; j < len && levels[j]; j++); for (k = j--; i < k; i++, j--) indices[i] = j; i--; @@ -1027,7 +1027,8 @@ draw_background (MFrame *frame, MDrawWindow win, int x, int y, if (gstring->from <= control->cursor_pos && gstring->to > control->cursor_pos) cursor_pos = control->cursor_pos; - if (cursor_bidi + if (cursor_pos >= 0 + && cursor_bidi && gstring->from <= control->cursor_pos - 1 && gstring->to > control->cursor_pos - 1) prev_pos = control->cursor_pos - 1; @@ -1089,11 +1090,9 @@ draw_background (MFrame *frame, MDrawWindow win, int x, int y, ? control->cursor_width : cursor_width); } else - { - if (cursor->bidi_level % 2) - rect.x += cursor_width - 1; - rect.width = 1; - } + rect.width = 1; + if (cursor->bidi_level % 2) + rect.x += cursor_width - rect.width; (*frame->driver->fill_space) (frame, win, rface, 1, rect.x, rect.y, rect.width, rect.height, control->clip_region); -- 1.7.10.4