diff options
-rw-r--r-- | generic/Text.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/generic/Text.c b/generic/Text.c index cec9102..998d9ee 100644 --- a/generic/Text.c +++ b/generic/Text.c @@ -513,8 +513,13 @@ ComputeCoordinates(Item item, } } /* ISSET(item->inv_flags, INV_TEXT_LAYOUT) */ - num_lines = ZnListSize(text->text_info); - height = num_lines * font_height + (num_lines-1) * text->spacing; + if (text->text_info) { + num_lines = ZnListSize(text->text_info); + height = num_lines * font_height + (num_lines-1) * text->spacing; + } + else { + height = 0; + } /* * The connected item support anchors, this is checked by @@ -763,7 +768,8 @@ Draw(Item item) /* * Setup the gc for the cursor and draw it. */ - if (cursor_line >= 0) { + if (cursor_line >= 0 && + (wi->focus_item == item) && ti->cursor_on) { int xs, ys; values.fill_style = FillSolid; @@ -991,7 +997,6 @@ Render(Item item) } } glDisable(GL_TEXTURE_2D); - #endif } @@ -1258,6 +1263,9 @@ MoveFromIndex(TextItem text, TextLineInfo lines, p; char *strp; + if (!text->text_info) { + return index; + } num_lines = ZnListSize(text->text_info); lines = p = ZnListArray(text->text_info); for (line_index = 0; line_index < num_lines; line_index++, p++) { |