Commit 916f5ba0 authored by kylechar's avatar kylechar Committed by Commit bot

mustash: Fix scale factor for bad physical_size.

On daisy devices the physical_size for display is being reported
incorrectly as (0, 0). Return a standard DPI in this case.

I've filled crbug.com/669554 for the bad physical_size value.

BUG=669554

Review-Url: https://codereview.chromium.org/2539843002
Cr-Commit-Position: refs/heads/master@{#435037}
parent f7a721ac
......@@ -28,7 +28,13 @@ const float kInchInMm = 25.4f;
float ComputeDisplayDPI(const gfx::Size& pixel_size,
const gfx::Size& physical_size) {
DCHECK(!physical_size.IsEmpty());
// The physical_size is broken for some devices, return standard DPI. See
// crbug.com/669554.
if (physical_size.IsEmpty()) {
LOG(ERROR) << "Display has empty phsical_size";
return 96.0f;
}
return (pixel_size.width() / static_cast<float>(physical_size.width())) *
kInchInMm;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment