зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1616245 - Use GetBounds instead of mBounds. r=jfkthame
It doesn't make sense to mix mBounds with GetClientBounds(), as the windows widget overrides both GetBounds() and GetClientBounds(). So if we're using GetClientBounds() for the client bounds, we should be using GetBounds() for the bounds. Differential Revision: https://phabricator.services.mozilla.com/D70232 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
186b7665c4
Коммит
c4cd70e6d4
|
@ -1449,21 +1449,22 @@ void nsBaseWidget::ResizeClient(const DesktopSize& aSize, bool aRepaint) {
|
|||
NS_ASSERTION((aSize.width >= 0), "Negative width passed to ResizeClient");
|
||||
NS_ASSERTION((aSize.height >= 0), "Negative height passed to ResizeClient");
|
||||
|
||||
LayoutDeviceIntRect bounds = GetBounds();
|
||||
LayoutDeviceIntRect clientBounds = GetClientBounds();
|
||||
|
||||
// GetClientBounds and mBounds are device pixels; scale back to desktop pixels
|
||||
// GetClientBounds and GetBounds are device pixels; scale back to desktop pixels
|
||||
// if that's what this widget uses for the Move/Resize APIs
|
||||
if (BoundsUseDesktopPixels()) {
|
||||
DesktopSize desktopDelta =
|
||||
(LayoutDeviceIntSize(mBounds.Width(), mBounds.Height()) -
|
||||
(LayoutDeviceIntSize(bounds.Width(), bounds.Height()) -
|
||||
clientBounds.Size()) /
|
||||
GetDesktopToDeviceScale();
|
||||
Resize(aSize.width + desktopDelta.width, aSize.height + desktopDelta.height,
|
||||
aRepaint);
|
||||
} else {
|
||||
LayoutDeviceSize layoutSize = aSize * GetDesktopToDeviceScale();
|
||||
Resize(mBounds.Width() + (layoutSize.width - clientBounds.Width()),
|
||||
mBounds.Height() + (layoutSize.height - clientBounds.Height()),
|
||||
Resize(bounds.Width() + (layoutSize.width - clientBounds.Width()),
|
||||
bounds.Height() + (layoutSize.height - clientBounds.Height()),
|
||||
aRepaint);
|
||||
}
|
||||
}
|
||||
|
@ -1472,6 +1473,7 @@ void nsBaseWidget::ResizeClient(const DesktopRect& aRect, bool aRepaint) {
|
|||
NS_ASSERTION((aRect.Width() >= 0), "Negative width passed to ResizeClient");
|
||||
NS_ASSERTION((aRect.Height() >= 0), "Negative height passed to ResizeClient");
|
||||
|
||||
LayoutDeviceIntRect bounds = GetBounds();
|
||||
LayoutDeviceIntRect clientBounds = GetClientBounds();
|
||||
LayoutDeviceIntPoint clientOffset = GetClientOffset();
|
||||
DesktopToLayoutDeviceScale scale = GetDesktopToDeviceScale();
|
||||
|
@ -1479,7 +1481,7 @@ void nsBaseWidget::ResizeClient(const DesktopRect& aRect, bool aRepaint) {
|
|||
if (BoundsUseDesktopPixels()) {
|
||||
DesktopPoint desktopOffset = clientOffset / scale;
|
||||
DesktopSize desktopDelta =
|
||||
(LayoutDeviceIntSize(mBounds.Width(), mBounds.Height()) -
|
||||
(LayoutDeviceIntSize(bounds.Width(), bounds.Height()) -
|
||||
clientBounds.Size()) /
|
||||
scale;
|
||||
Resize(aRect.X() - desktopOffset.x, aRect.Y() - desktopOffset.y,
|
||||
|
@ -1488,8 +1490,8 @@ void nsBaseWidget::ResizeClient(const DesktopRect& aRect, bool aRepaint) {
|
|||
} else {
|
||||
LayoutDeviceRect layoutRect = aRect * scale;
|
||||
Resize(layoutRect.X() - clientOffset.x, layoutRect.Y() - clientOffset.y,
|
||||
layoutRect.Width() + mBounds.Width() - clientBounds.Width(),
|
||||
layoutRect.Height() + mBounds.Height() - clientBounds.Height(),
|
||||
layoutRect.Width() + bounds.Width() - clientBounds.Width(),
|
||||
layoutRect.Height() + bounds.Height() - clientBounds.Height(),
|
||||
aRepaint);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче