Bug 1166382 - Use the adjusted full zoom in nsDocument::GetViewportInfo(). r=tn

--HG--
extra : source : 13d43f2b9bc95018f5ed419a2649f0e5736029c8
This commit is contained in:
Botond Ballo 2015-05-29 14:28:05 -04:00
Родитель 8ac561eb1d
Коммит 90b66cb081
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -7879,7 +7879,11 @@ nsDocument::GetViewportInfo(const ScreenIntSize& aDisplaySize)
// Compute the CSS-to-LayoutDevice pixel scale as the product of the // Compute the CSS-to-LayoutDevice pixel scale as the product of the
// widget scale and the full zoom. // widget scale and the full zoom.
nsPresContext* context = mPresShell->GetPresContext(); nsPresContext* context = mPresShell->GetPresContext();
float fullZoom = context ? context->GetFullZoom() : 1.0; // When querying the full zoom, get it from the device context rather than
// directly from the pres context, because the device context's value can
// include an adjustment necessay to keep the number of app units per device
// pixel an integer, and we want the adjusted value.
float fullZoom = context ? context->DeviceContext()->GetFullZoom() : 1.0;
fullZoom = (fullZoom == 0.0) ? 1.0 : fullZoom; fullZoom = (fullZoom == 0.0) ? 1.0 : fullZoom;
nsIWidget *widget = nsContentUtils::WidgetForDocument(this); nsIWidget *widget = nsContentUtils::WidgetForDocument(this);
float widgetScale = widget ? widget->GetDefaultScale().scale : 1.0f; float widgetScale = widget ? widget->GetDefaultScale().scale : 1.0f;