Bug 1358758 - Use CSSIntRect for nsIFrame::GetScreenRect. r=kats
MozReview-Commit-ID: KXPL1ERbFDa
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user