mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-04 07:40:42 +00:00
Bug 389359: In print-preview jump-to-page, scale page-position so we arrive at correct spot. r+sr=roc, a=blocking1.9+
This commit is contained in:
parent
bf3813bca3
commit
122cc4ab89
@ -3659,8 +3659,15 @@ DocumentViewerImpl::PrintPreviewNavigate(PRInt16 aType, PRInt32 aPageNum)
|
||||
}
|
||||
nscoord deadSpaceGap = mPresContext->TwipsToAppUnits(deadSpaceGapTwips);
|
||||
|
||||
// scroll so that top of page (plus the gray area) is at the top of the scroll area
|
||||
scrollableView->ScrollTo(0, fndPageFrame->GetPosition().y-deadSpaceGap, PR_TRUE);
|
||||
// XXXdholbert: deadSpaceGap should be subtracted from
|
||||
// fndPageFrame->GetPosition().y, before the scaling. However,
|
||||
// deadSpaceGap isn't matching up to the actual visible dead space in Print
|
||||
// Preview right now -- see bug 414075. Hence, ignoring deadSpaceGap for
|
||||
// now -- instead, we'll navigate to exactly the top of the given page.
|
||||
nscoord newYPosn =
|
||||
nscoord(mPrintEngine->GetPrintPreviewScale() *
|
||||
float(fndPageFrame->GetPosition().y));
|
||||
scrollableView->ScrollTo(0, newYPosn, PR_TRUE);
|
||||
}
|
||||
return NS_OK;
|
||||
|
||||
|
@ -199,6 +199,9 @@ public:
|
||||
|
||||
nsIViewManager* GetPrintPreviewViewManager() {return mPrtPreview->mPrintObject->mViewManager;}
|
||||
|
||||
float GetPrintPreviewScale() { return mPrtPreview->mPrintObject->
|
||||
mPresContext->GetPrintPreviewScale(); }
|
||||
|
||||
static nsIPresShell* GetPresShellFor(nsIDocShell* aDocShell);
|
||||
|
||||
// These calls also update the DocViewer
|
||||
|
Loading…
x
Reference in New Issue
Block a user