Correct measurement for owner drawn menu items with only unchecked bitmap.
Check for either checked or unchecked bitmap being specified for the item instead of checking the checked/normal bitmap twice which was an obvious typo and also resulted in items with unchecked bitmap only not being measured correctly (although I'm not sure if this is actually a supported use case). Closes #12846. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -882,7 +882,7 @@ bool wxMenuItem::OnMeasureItem(size_t *width, size_t *height)
|
|||||||
*width += imgWidth + data->CheckBgMargin.GetTotalX();
|
*width += imgWidth + data->CheckBgMargin.GetTotalX();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_bmpChecked.IsOk() || m_bmpChecked.IsOk() )
|
if ( m_bmpChecked.IsOk() || m_bmpUnchecked.IsOk() )
|
||||||
{
|
{
|
||||||
// get size of bitmap always return valid value (0 for invalid bitmap),
|
// get size of bitmap always return valid value (0 for invalid bitmap),
|
||||||
// so we don't needed check if bitmap is valid ;)
|
// so we don't needed check if bitmap is valid ;)
|
||||||
|
|||||||
Reference in New Issue
Block a user