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

@@ -878,6 +878,9 @@ public:
void DisableOffset() { EnableOffset(false); }
bool OffsetEnabled() const { return m_enableOffset; }
void SetContentScaleFactor(double contentScaleFactor);
double GetContentScaleFactor() const { return m_contentScaleFactor; }
protected:
// These fields must be initialized in the derived class ctors.
wxDouble m_width,
@@ -912,6 +915,7 @@ private:
// Create() or the associated window of the wxDC this context was created
// from.
wxWindow* const m_window;
double m_contentScaleFactor;
wxDECLARE_NO_COPY_CLASS(wxGraphicsContext);
wxDECLARE_ABSTRACT_CLASS(wxGraphicsContext);