diff --git a/view/nsView.cpp b/view/nsView.cpp index c190ea2094aa..66731eb0a335 100644 --- a/view/nsView.cpp +++ b/view/nsView.cpp @@ -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(mFrame)); for (nsView* kid = mFirstChild; kid; kid = kid->GetNextSibling()) { diff --git a/view/nsViewManager.cpp b/view/nsViewManager.cpp index 230512c0dcc0..1c5e87c4c4c1 100644 --- a/view/nsViewManager.cpp +++ b/view/nsViewManager.cpp @@ -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()); } }