Add wxDisplayImpl::GetScaleFactor() and implement it for wxGTK

We need to account for the scale factor under GTK+ (and, presumably,
under macOS) to compute the correct PPI value as it must use the number
of physical and not logical pixels.
This commit is contained in:
Vadim Zeitlin
2018-10-29 17:41:37 +01:00
parent 43d2b1db0e
commit f09b9dbfa2
3 changed files with 28 additions and 4 deletions

View File

@@ -81,8 +81,11 @@ public:
// return the depth or 0 if unknown
virtual int GetDepth() const = 0;
// return the resolution of the display, uses GetSizeMM() by default but
// can be also overridden directly
// return the scale factor used to convert logical pixels to physical ones
virtual double GetScaleFactor() const { return 1.0; }
// return the resolution of the display, uses GetSize(), GetScaleFactor()
// and GetSizeMM() by default but can be also overridden directly
virtual wxSize GetPPI() const;
// return the physical size of the display or (0, 0) if unknown: this is