Bug 1727289 - Prefer widget scale for scrollbar parts. r=mstange

Print preview documents might use a different DPI depending on the print
target.

Differential Revision: https://phabricator.services.mozilla.com/D123939
This commit is contained in:
Emilio Cobos Alvarez 2021-08-30 18:01:44 +00:00
parent 25a76b9440
commit d1f5731c04

View File

@ -342,6 +342,9 @@ static std::pair<sRGBColor, sRGBColor> SystemColorPair(
/* static */
auto nsNativeBasicTheme::GetDPIRatioForScrollbarPart(nsPresContext* aPc)
-> DPIRatio {
if (auto* widget = aPc->GetRootPresContext()->GetRootWidget()) {
return widget->GetDefaultScale();
}
return DPIRatio(float(AppUnitsPerCSSPixel()) /
aPc->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom());
}