added a plausibility check to the dpi calculation

This commit is contained in:
hneemann 2017-06-07 13:38:34 +02:00
parent 1b032b7975
commit fa9f57f6dc

View File

@ -379,6 +379,7 @@ public final class Keys {
int widthInInch = widthInPixel / dpi; int widthInInch = widthInPixel / dpi;
// most people don't use a screen larger than 27 inch, so the resolution is presumably wrong // most people don't use a screen larger than 27 inch, so the resolution is presumably wrong
if (widthInInch > 27) if (widthInInch > 27)
// assume a 27 inch screen
dpi = widthInPixel / 27; dpi = widthInPixel / 27;
return dpi; return dpi;