Adjust the height of the underline to be compatible with native MSW behaviour.
Notice that in wxGTK we should use pango_font_metrics_get_underline_position()
to get the font-dependent value that should be used here.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67060
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// it should be of the same colour as text
SetPen(wxPen(GetTextForeground(), 0, wxPENSTYLE_SOLID));
- yUnderscore--;
+ // This adjustment is relatively arbitrary: we need to draw the
+ // underline slightly higher to avoid overflowing the character cell
+ // but whether we should do it 1, 2 or 3 pixels higher is not clear.
+ //
+ // The currently used value seems to be compatible with native MSW
+ // behaviour, i.e. it results in the same appearance of the owner-drawn
+ // and normal labels.
+ yUnderscore -= 2;
DrawLine(startUnderscore, yUnderscore, endUnderscore, yUnderscore);
}