From c6a405e8409caa524bb4e763f6ca696ebcc77715 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Mon, 30 Mar 2020 00:09:28 +0200 Subject: [PATCH] Fix hack for height calc. --- source/widgets/listview.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/widgets/listview.c b/source/widgets/listview.c index 09ab718d..8739a846 100644 --- a/source/widgets/listview.c +++ b/source/widgets/listview.c @@ -670,10 +670,10 @@ listview *listview_create ( widget *parent, const char *name, listview_update_ca listview_create_row ( lv, &row ); // FIXME: hack to scale hight correctly. if ( lv->eh > 1 && row.textbox ) { - char buff[lv->eh*2+1] ; - memset( buff, '\0', lv->eh*2+1); - for ( unsigned int i = 0; i < lv->eh; i++) { buff[i] ='\n'; }; - textbox_text( row.textbox, buff); + char buff[lv->eh*2+1] ; + memset( buff, '\0', lv->eh*2+1); + for ( unsigned int i = 0; i < (lv->eh-1); i++) { buff[i*2] = 'a'; buff[i*2+1] ='\n'; }; + textbox_text( row.textbox, buff); } lv->element_height = widget_get_desired_height ( WIDGET ( row.box ) ); widget_free ( WIDGET ( row.box ) );