Fix wxFont construction from default wxFontInfo in wxMSW.
Don't use -1 as the real point size. Also update the font sample to allow testing such font. Closes #16468. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -360,7 +360,7 @@ void wxFontRefData::Init(int pointSize,
|
||||
if ( m_sizeUsingPixels )
|
||||
SetPixelSize(pixelSize);
|
||||
else
|
||||
SetPointSize(pointSize);
|
||||
SetPointSize(pointSize == -1 ? wxNORMAL_FONT->GetPointSize() : pointSize);
|
||||
|
||||
SetStyle(style);
|
||||
SetWeight(weight);
|
||||
@@ -841,7 +841,7 @@ bool wxFont::DoCreate(int pointSize,
|
||||
|
||||
// wxDEFAULT is a valid value for the font size too so we must treat it
|
||||
// specially here (otherwise the size would be 70 == wxDEFAULT value)
|
||||
if ( pointSize == wxDEFAULT || pointSize == -1 )
|
||||
if ( pointSize == wxDEFAULT )
|
||||
{
|
||||
pointSize = wxNORMAL_FONT->GetPointSize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user