From 66c3f644ad180ac0f08fb81672a5628326f31a18 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Fri, 5 Jul 2002 14:29:40 +0000 Subject: * (ComputeCursorAndSel, ComputeCoordinates): Corrections afin de permettre l'affichage du curseur lorsqu'il n'y a pas de caract�res. --- generic/Text.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'generic/Text.c') diff --git a/generic/Text.c b/generic/Text.c index e5aaa97..cec9102 100644 --- a/generic/Text.c +++ b/generic/Text.c @@ -408,10 +408,6 @@ ComputeCoordinates(Item item, ResetBBox(&item->item_bounding_box); - if (text->num_chars == 0) { - return; - } - Tk_GetFontMetrics(text->font, &fm); font_height = fm.ascent+fm.descent; @@ -459,7 +455,8 @@ ComputeCoordinates(Item item, num = strlen(scan); } info.num_chars = Tk_MeasureChars(text->font, scan, num, wrap, - TK_WHOLE_WORDS|TK_AT_LEAST_ONE, &info.width); + TK_WHOLE_WORDS|TK_AT_LEAST_ONE, + &info.width); info.start = scan; text->max_width = MAX(info.width, text->max_width); @@ -635,6 +632,9 @@ ComputeCursorAndSel(Item item, TextLineInfo lines_ptr; int i, line_index, char_index; + if (num_lines == 0) { + *cursor_line = 0; + } for (i = 0, lines_ptr = lines; i < num_lines; i++, lines_ptr++) { /* * Mark the line with the cursor and compute its -- cgit v1.1