Skip to content

Commit

Permalink
Fix determining height of monochrome HICON in wxGetHiconSize()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
a-wi committed Apr 16, 2021
1 parent 9ef30e7 commit b889f68
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/msw/gdiimage.cpp
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit b889f68

Please sign in to comment.