bug 861112 - (widget/gtk2) scaling from display to device pixels should only apply to top-level windows/dialogs/popups, not to child or plugin windows. r=roc

This commit is contained in:
Jonathan Kew 2013-04-13 08:53:47 +01:00
parent e4232965a8
commit 174ccacffb

View File

@ -995,7 +995,8 @@ nsWindow::Show(bool aState)
NS_IMETHODIMP
nsWindow::Resize(double aWidth, double aHeight, bool aRepaint)
{
double scale = GetDefaultScale();
double scale =
mWindowType <= eWindowType_popup ? GetDefaultScale() : 1.0;
int32_t width = NSToIntRound(scale * aWidth);
int32_t height = NSToIntRound(scale * aHeight);
ConstrainSize(&width, &height);
@ -1075,7 +1076,8 @@ NS_IMETHODIMP
nsWindow::Resize(double aX, double aY, double aWidth, double aHeight,
bool aRepaint)
{
double scale = GetDefaultScale();
double scale =
mWindowType <= eWindowType_popup ? GetDefaultScale() : 1.0;
int32_t width = NSToIntRound(scale * aWidth);
int32_t height = NSToIntRound(scale * aHeight);
ConstrainSize(&width, &height);
@ -1163,7 +1165,8 @@ nsWindow::Move(double aX, double aY)
LOG(("nsWindow::Move [%p] %f %f\n", (void *)this,
aX, aY));
double scale = GetDefaultScale();
double scale =
mWindowType <= eWindowType_popup ? GetDefaultScale() : 1.0;
int32_t x = NSToIntRound(aX * scale);
int32_t y = NSToIntRound(aY * scale);