aboutsummaryrefslogtreecommitdiff
path: root/generic/Text.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/Text.c')
-rw-r--r--generic/Text.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/generic/Text.c b/generic/Text.c
index 0ab6e30..c2b8278 100644
--- a/generic/Text.c
+++ b/generic/Text.c
@@ -509,12 +509,13 @@ ComputeCoordinates(ZnItem item,
}
} /* ISSET(item->inv_flags, INV_TEXT_LAYOUT) */
+
+ height = font_height;
if (text->text_info) {
+ int h;
num_lines = ZnListSize(text->text_info);
- height = num_lines * font_height + (num_lines-1) * text->spacing;
- }
- else {
- height = 0;
+ h = num_lines * font_height + (num_lines-1) * text->spacing;
+ height = MAX(height, h);
}
/*
@@ -714,9 +715,10 @@ Draw(ZnItem item)
int sel_first_line=-1, sel_last_line=-1, cursor_line=-1;
unsigned int sel_start_offset=0, sel_stop_offset=0, cursor_offset=0;
- if (!text->text_info || !text->text) {
+ if (!text->text_info/* || !text->text*/) {
return;
}
+
lines = (TextLineInfo) ZnListArray(text->text_info);
num_lines = ZnListSize(text->text_info);
Tk_GetFontMetrics(text->font, &fm);
@@ -865,7 +867,7 @@ Render(ZnItem item)
int sel_first_line=-1, sel_last_line=-1, cursor_line=-1;
int sel_start_offset=0, sel_stop_offset=0, cursor_offset=0;
- if (!text->text_info || !text->text || !text->tfi) {
+ if (!text->text_info || !text->tfi) {
return;
}