mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1246382 - Screen rect in desktop pixels should not be affected by devPixelsPerPx override. r=emk
This commit is contained in:
parent
8fa34d8925
commit
68230b138c
@ -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);
|
||||
|
@ -38,8 +38,6 @@ public:
|
||||
NS_IMETHOD GetDefaultCSSScaleFactor(double* aScaleFactor) override;
|
||||
|
||||
private:
|
||||
double GetDPIScale();
|
||||
|
||||
HMONITOR mScreen;
|
||||
uint32_t mId;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user