From 261c128b844260293dd306bbbe6dd5f19f4c5bc9 Mon Sep 17 00:00:00 2001 From: Alex Kompel Date: Sun, 12 Apr 2015 17:47:42 -0700 Subject: [PATCH] win32-gui: fix menu item measuring bug (ever-increasing item height on window resize) --- win/win32/mhmenu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/win/win32/mhmenu.c b/win/win32/mhmenu.c index 5b0e3b5d8..c9c64f08b 100644 --- a/win/win32/mhmenu.c +++ b/win/win32/mhmenu.c @@ -884,12 +884,11 @@ BOOL onMeasureItem(HWND hWnd, WPARAM wParam, LPARAM lParam) /* Set the height of the list box items to max height of the individual items */ for( i=0; imenu.size; i++) { if( NHMENU_HAS_GLYPH(data->menu.items[i]) && !IS_MAP_ASCII(iflags.wc_map_mode) ) { - lpmis->itemHeight = max( lpmis->itemHeight, (UINT)max(tm.tmHeight, GetNHApp()->mapTile_Y) ); + lpmis->itemHeight = max( lpmis->itemHeight, (UINT)max(tm.tmHeight, GetNHApp()->mapTile_Y)+2 ); } else { - lpmis->itemHeight = max( lpmis->itemHeight, (UINT)max(tm.tmHeight, TILE_Y) ); + lpmis->itemHeight = max( lpmis->itemHeight, (UINT)max(tm.tmHeight, TILE_Y)+2 ); } } - lpmis->itemHeight += 2; /* set width to the window width */ lpmis->itemWidth = list_rect.right - list_rect.left; -- 2.40.0