Implement 0-width pen consistently in wxGraphicsContext

Emulate a 1-pixel pen width as closely as possible.

This reverts:
334cf1cc91 (Take HiDPI scale into account for wxGCDC 0-width pen, 2021-04-03)
0d80050057 (Make wxGCDC behavior with 0-width wxPen consistent with MSW wxDC, 2021-03-02)

See #19077, #19115
This commit is contained in:
Paul Cornett
2021-04-05 09:56:28 -07:00
parent a2e4cb6cec
commit 52cc838b12
10 changed files with 190 additions and 130 deletions

View File

@@ -572,6 +572,7 @@ wxGraphicsContext::wxGraphicsContext(wxGraphicsRenderer* renderer,
m_enableOffset(false),
m_window(window)
{
m_contentScaleFactor = window ? window->GetContentScaleFactor() : 1.0;
}
wxGraphicsContext::~wxGraphicsContext()
@@ -605,6 +606,12 @@ void wxGraphicsContext::EnableOffset(bool enable)
m_enableOffset = enable;
}
void wxGraphicsContext::SetContentScaleFactor(double contentScaleFactor)
{
m_enableOffset = true;
m_contentScaleFactor = contentScaleFactor;
}
#if 0
void wxGraphicsContext::SetAlpha( wxDouble WXUNUSED(alpha) )
{