From 9c7b5fe7a9652bcbae54c209ce9fbf172d4821bb Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Tue, 3 Jan 2017 00:59:37 +0100 Subject: [PATCH] Restructure for readability. no change --- source/widgets/listview.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/widgets/listview.c b/source/widgets/listview.c index 813e7816..ad61411a 100644 --- a/source/widgets/listview.c +++ b/source/widgets/listview.c @@ -469,7 +469,9 @@ static int listview_get_desired_height ( widget *wid ) if ( h == 0 ) { return widget_padding_get_padding_height ( WIDGET (lv) ); } - return h * lv->element_height + ( h - 1 ) * lv->spacing+widget_padding_get_padding_height ( WIDGET (lv) ); + int height = widget_padding_get_padding_height ( WIDGET (lv) ); + height += h*(lv->element_height+lv->spacing) - lv->spacing; + return height; } void listview_set_show_scrollbar ( listview *lv, gboolean enabled )