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:
@@ -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
|
||||
|
Reference in New Issue
Block a user