Bug 1358758 - Use CSSIntRect for nsIFrame::GetScreenRect. r=kats

MozReview-Commit-ID: KXPL1ERbFDa
This commit is contained in:
Masatoshi Kimura
2017-04-25 07:33:13 +09:00
parent bd21ddc865
commit fd136e7327
14 changed files with 60 additions and 48 deletions

View File

@@ -588,13 +588,13 @@ nsBaseDragService::DrawDrag(nsIDOMNode* aDOMNode,
if (!enableDragImages || !mHasImage) {
// if a region was specified, set the screen rectangle to the area that
// the region occupies
nsIntRect dragRect;
CSSIntRect dragRect;
if (aRegion) {
// the region's coordinates are relative to the root frame
aRegion->GetBoundingBox(&dragRect.x, &dragRect.y, &dragRect.width, &dragRect.height);
nsIFrame* rootFrame = presShell->GetRootFrame();
nsIntRect screenRect = rootFrame->GetScreenRect();
CSSIntRect screenRect = rootFrame->GetScreenRect();
dragRect.MoveBy(screenRect.TopLeft());
}
else {
@@ -607,9 +607,10 @@ nsBaseDragService::DrawDrag(nsIDOMNode* aDOMNode,
}
}
dragRect = ToAppUnits(dragRect, nsPresContext::AppUnitsPerCSSPixel()).
ToOutsidePixels((*aPresContext)->AppUnitsPerDevPixel());
aScreenDragRect->SizeTo(dragRect.width, dragRect.height);
nsIntRect dragRectDev =
ToAppUnits(dragRect, nsPresContext::AppUnitsPerCSSPixel()).
ToOutsidePixels((*aPresContext)->AppUnitsPerDevPixel());
aScreenDragRect->SizeTo(dragRectDev.width, dragRectDev.height);
return NS_OK;
}