Skip to content

Commit

Permalink
Fix bug where fixed (left) column(s) in grid control may have uninit.…
Browse files Browse the repository at this point in the history
… width. This made the template grid view blank (light grey).
  • Loading branch information
AndrewWPhillips committed May 13, 2016
1 parent f1c1eb0 commit 6915244
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion HexEdit/GridCtrl_src/GridCtrl.cpp
Expand Up @@ -5171,11 +5171,12 @@ void CGridCtrl::ExpandColsNice(BOOL bExpandFixed /*=TRUE*/, UINT nAutoSizeStyle
if (m_arColWidths[col] == 0) // skip hidden columns
continue;

int new_width;
int new_width = m_arColWidths[col]; // default to old width
if (col == last_col && fixed_width + var_width < rect.Width())
new_width = rect.Width() - total_width; // if expanding set last adjustable column to match window width exactly
else if ((col >= GetFixedColumnCount() || bExpandFixed) && m_arColWidths[col] > 0)
new_width = int(min_size[col] * factor);

if (OnResizeColumn(col, new_width))
m_arColWidths[col] = new_width;

Expand Down

0 comments on commit 6915244

Please sign in to comment.