Return "logical" PPI from wxDisplay::GetPPI() in wxGTK3
Just scale the standard PPI by the scaling factor instead of trying to compute the actual physical PPI, as the latter is not useful and is incompatible with the value used by all the other applications.
This commit is contained in:
parent
52b25211c8
commit
e902050002
1 changed files with 13 additions and 1 deletions
|
|
@ -350,7 +350,17 @@ double wxDisplayImplGTK::GetScaleFactor() const
|
|||
|
||||
return 1.0;
|
||||
}
|
||||
#endif // GTK+ 3.10
|
||||
|
||||
wxSize wxDisplayImplGTK::GetPPI() const
|
||||
{
|
||||
// The useful value of PPI is the scaled value of the default PPI and not
|
||||
// the actual PPI computed by dividing the number of pixels by the physical
|
||||
// screen size: this is what everyone else uses, and so we should do it
|
||||
// too.
|
||||
return wxDisplay::GetStdPPI()*GetScaleFactor();
|
||||
}
|
||||
|
||||
#else // GTK+ < 3.10
|
||||
|
||||
wxSize wxDisplayImplGTK::GetPPI() const
|
||||
{
|
||||
|
|
@ -370,6 +380,8 @@ wxSize wxDisplayImplGTK::GetPPI() const
|
|||
return ppi;
|
||||
}
|
||||
|
||||
#endif // GTK+ 3.10
|
||||
|
||||
wxSize wxDisplayImplGTK::GetSizeMM() const
|
||||
{
|
||||
wxSize sizeMM;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue