Fix determining height of monochrome HICON in wxGetHiconSize()

For monochrome icons height reported by GetObject() is doubled because
icon bitmap contains both AND and XOR masks. To get actual icon height
we need to divide the value by 2.

Closes #19146.
This commit is contained in:
Artur Wieczorek
2021-04-17 00:00:54 +02:00
parent 9ef30e728a
commit b889f6897b

View File

@@ -660,6 +660,12 @@ wxSize wxGetHiconSize(HICON hicon)
size = wxSize(bm.bmWidth, bm.bmHeight);
}
}
// For monochrome icon reported height is doubled
// because it contains both AND and XOR masks.
if ( info.hbmColor == NULL )
{
size.y /= 2;
}
}
}