aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generic/Text.c10
1 files changed, 5 insertions, 5 deletions
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