From 6cc1d63d68f746cf9e48b75edd119a4cb4309f25 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 9 Apr 2019 13:37:42 +0200 Subject: [PATCH] Add a comment to wxToolBar::DoGetBestSize() No real changes, just explain one of the changes done in the commit 909adbb6bf832ada3db034cffc5548b8309a1602 a bit better. --- src/msw/toolbar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index e54bad0745..85d56eb2f5 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -602,7 +602,11 @@ wxSize wxToolBar::DoGetBestSize() const wxToolBarTool * const tool = static_cast(node->GetData()); - RECT rcItem = wxGetTBItemRect(GetHwnd(), toolIndex++); + // Note that we can't just reuse sizeTool here, even though all normal + // items do have this size, this is not true for the separators and it + // is both more robust and simpler to just always use TB_GETITEMRECT + // rather than handling the separators specially. + const RECT rcItem = wxGetTBItemRect(GetHwnd(), toolIndex++); if ( IsVertical() ) {