зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1423551: Use BaseRect access methods instead of member variables in view/. r=jet
MozReview-Commit-ID: 1VlWJWAqRB3 --HG-- extra : rebase_source : 4c713d43fda024ac4f2c590b77c84ad3cfbd9ff5
This commit is contained in:
Родитель
44670d63c5
Коммит
3db2b5ee67
|
@ -194,8 +194,7 @@ void nsView::Destroy()
|
|||
|
||||
void nsView::SetPosition(nscoord aX, nscoord aY)
|
||||
{
|
||||
mDimBounds.x += aX - mPosX;
|
||||
mDimBounds.y += aY - mPosY;
|
||||
mDimBounds.MoveBy(aX - mPosX, aY - mPosY);
|
||||
mPosX = aX;
|
||||
mPosY = aY;
|
||||
|
||||
|
@ -291,8 +290,8 @@ LayoutDeviceIntRect nsView::CalcWidgetBounds(nsWindowType aType)
|
|||
|
||||
// Compute where the top-left of our widget ended up relative to the parent
|
||||
// widget, in appunits.
|
||||
nsPoint roundedOffset(NSIntPixelsToAppUnits(newBounds.x, p2a),
|
||||
NSIntPixelsToAppUnits(newBounds.y, p2a));
|
||||
nsPoint roundedOffset(NSIntPixelsToAppUnits(newBounds.X(), p2a),
|
||||
NSIntPixelsToAppUnits(newBounds.Y(), p2a));
|
||||
|
||||
// mViewToWidgetOffset is added to coordinates relative to the view origin
|
||||
// to get coordinates relative to the widget.
|
||||
|
@ -365,15 +364,15 @@ void nsView::DoResetWidgetBounds(bool aMoveOnly,
|
|||
DesktopRect deskRect = newBounds / scale;
|
||||
if (changedPos) {
|
||||
if (changedSize && !aMoveOnly) {
|
||||
widget->ResizeClient(deskRect.x, deskRect.y,
|
||||
deskRect.width, deskRect.height,
|
||||
widget->ResizeClient(deskRect.X(), deskRect.Y(),
|
||||
deskRect.Width(), deskRect.Height(),
|
||||
aInvalidateChangedSize);
|
||||
} else {
|
||||
widget->MoveClient(deskRect.x, deskRect.y);
|
||||
widget->MoveClient(deskRect.X(), deskRect.Y());
|
||||
}
|
||||
} else {
|
||||
if (changedSize && !aMoveOnly) {
|
||||
widget->ResizeClient(deskRect.width, deskRect.height,
|
||||
widget->ResizeClient(deskRect.Width(), deskRect.Height(),
|
||||
aInvalidateChangedSize);
|
||||
} // else do nothing!
|
||||
}
|
||||
|
@ -812,12 +811,12 @@ void nsView::List(FILE* out, int32_t aIndent) const
|
|||
int32_t Z = mWindow->GetZIndex();
|
||||
fprintf(out, "(widget=%p[%" PRIuPTR "] z=%d pos={%d,%d,%d,%d}) ",
|
||||
(void*)mWindow, widgetRefCnt, Z,
|
||||
nonclientBounds.x, nonclientBounds.y,
|
||||
windowBounds.width, windowBounds.height);
|
||||
nonclientBounds.X(), nonclientBounds.Y(),
|
||||
windowBounds.Width(), windowBounds.Height());
|
||||
}
|
||||
nsRect brect = GetBounds();
|
||||
fprintf(out, "{%d,%d,%d,%d}",
|
||||
brect.x, brect.y, brect.width, brect.height);
|
||||
brect.X(), brect.Y(), brect.Width(), brect.Height());
|
||||
fprintf(out, " z=%d vis=%d frame=%p <\n",
|
||||
mZIndex, mVis, static_cast<void*>(mFrame));
|
||||
for (nsView* kid = mFirstChild; kid; kid = kid->GetNextSibling()) {
|
||||
|
|
|
@ -128,8 +128,8 @@ nsViewManager::CreateView(const nsRect& aBounds,
|
|||
{
|
||||
auto *v = new nsView(this, aVisibilityFlag);
|
||||
v->SetParent(aParent);
|
||||
v->SetPosition(aBounds.x, aBounds.y);
|
||||
nsRect dim(0, 0, aBounds.width, aBounds.height);
|
||||
v->SetPosition(aBounds.X(), aBounds.Y());
|
||||
nsRect dim(0, 0, aBounds.Width(), aBounds.Height());
|
||||
v->SetDimensions(dim, false);
|
||||
return v;
|
||||
}
|
||||
|
@ -165,8 +165,8 @@ nsViewManager::GetWindowDimensions(nscoord *aWidth, nscoord *aHeight)
|
|||
if (nullptr != mRootView) {
|
||||
if (mDelayedResize == nsSize(NSCOORD_NONE, NSCOORD_NONE)) {
|
||||
nsRect dim = mRootView->GetDimensions();
|
||||
*aWidth = dim.width;
|
||||
*aHeight = dim.height;
|
||||
*aWidth = dim.Width();
|
||||
*aHeight = dim.Height();
|
||||
} else {
|
||||
*aWidth = mDelayedResize.width;
|
||||
*aHeight = mDelayedResize.height;
|
||||
|
@ -188,7 +188,7 @@ void nsViewManager::DoSetWindowDimensions(nscoord aWidth, nscoord aHeight)
|
|||
// Don't resize the widget. It is already being set elsewhere.
|
||||
mRootView->SetDimensions(newDim, true, false);
|
||||
if (mPresShell)
|
||||
mPresShell->ResizeReflow(aWidth, aHeight, oldDim.width, oldDim.height);
|
||||
mPresShell->ResizeReflow(aWidth, aHeight, oldDim.Width(), oldDim.Height());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче