Fix wxMemoryDC::SetFont(wxNullFont) broken by recent changes
Fix crash in this function introduced by 9e5c8a8027 (Respect bitmap
content scale factor in wxMSW wxMemoryDC, 2022-03-26).
Also add a unit test ensuring that this doesn't get broken again under
MSW, which seems to be the only place where it works.
Closes #22240.
This commit is contained in:
@@ -87,6 +87,14 @@ TEST_CASE("wxMemoryDC::GetTextExtent", "[memdc][text-extent]")
|
||||
wxBitmap bmp(100, 100);
|
||||
wxMemoryDC memdc(bmp);
|
||||
GetTextExtentTester<wxMemoryDC> testMem(memdc);
|
||||
|
||||
// Under MSW, this wxDC should work even without any valid font -- but
|
||||
// this is not the case under wxGTK and probably neither elsewhere, so
|
||||
// restrict this test to that platform only.
|
||||
#ifdef __WXMSW__
|
||||
memdc.SetFont(wxNullFont);
|
||||
GetTextExtentTester<wxMemoryDC> testMemNoFont(memdc);
|
||||
#endif // __WXMSW__
|
||||
}
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
|
||||
|
||||
Reference in New Issue
Block a user