Bug 1246382 - Screen rect in desktop pixels should not be affected by devPixelsPerPx override. r=emk

This commit is contained in:
Jonathan Kew 2016-02-08 12:53:10 +00:00
parent 8fa34d8925
commit 68230b138c
2 changed files with 2 additions and 14 deletions

View File

@ -102,16 +102,6 @@ nsScreenWin::GetAvailRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth,
} // GetAvailRect
double
nsScreenWin::GetDPIScale()
{
double dpiScale= nsIWidget::DefaultScaleOverride();
if (dpiScale <= 0.0) {
dpiScale = widget::WinUtils::LogToPhysFactor(mScreen);
}
return dpiScale;
}
NS_IMETHODIMP
nsScreenWin::GetRectDisplayPix(int32_t *outLeft, int32_t *outTop,
int32_t *outWidth, int32_t *outHeight)
@ -125,7 +115,7 @@ nsScreenWin::GetRectDisplayPix(int32_t *outLeft, int32_t *outTop,
if (NS_FAILED(rv)) {
return rv;
}
double scaleFactor = 1.0 / GetDPIScale();
double scaleFactor = 1.0 / widget::WinUtils::LogToPhysFactor(mScreen);
*outLeft = NSToIntRound(left * scaleFactor);
*outTop = NSToIntRound(top * scaleFactor);
*outWidth = NSToIntRound(width * scaleFactor);
@ -146,7 +136,7 @@ nsScreenWin::GetAvailRectDisplayPix(int32_t *outLeft, int32_t *outTop,
if (NS_FAILED(rv)) {
return rv;
}
double scaleFactor = 1.0 / GetDPIScale();
double scaleFactor = 1.0 / widget::WinUtils::LogToPhysFactor(mScreen);
*outLeft = NSToIntRound(left * scaleFactor);
*outTop = NSToIntRound(top * scaleFactor);
*outWidth = NSToIntRound(width * scaleFactor);

View File

@ -38,8 +38,6 @@ public:
NS_IMETHOD GetDefaultCSSScaleFactor(double* aScaleFactor) override;
private:
double GetDPIScale();
HMONITOR mScreen;
uint32_t mId;
};