зеркало из https://github.com/mozilla/gecko-dev.git
Added 1 pixel to the invalidate rect to compensate for twips to pixel rounding error. bug=63951; sr=karnaze@netscape.com; r=attinasi@netscape.com
This commit is contained in:
Родитель
76db806bca
Коммит
e6b6217eb3
|
@ -4630,7 +4630,16 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext,
|
|||
// has actually changed...
|
||||
/*if (eReflowReason_Incremental == aReflowState.reason ||
|
||||
eReflowReason_Dirty == aReflowState.reason) {*/
|
||||
maxFrameWidth = PR_MAX(maxFrameWidth, mRect.width);
|
||||
// XXX See bug 71523 We should really adjust the frames x coordinate to
|
||||
// a pixel boundary to solve this.
|
||||
// For now we add 1 pixel to the width of the invalidated rect.
|
||||
// This fixes cases where the twips to pixel roundoff causes the invalidated
|
||||
// rect's width to be one pixel short.
|
||||
float p2t;
|
||||
aPresContext->GetScaledPixelsToTwips(&p2t);
|
||||
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
|
||||
|
||||
maxFrameWidth = PR_MAX(maxFrameWidth, mRect.width) + onePixel;
|
||||
maxFrameHeight = PR_MAX(maxFrameHeight, mRect.height);
|
||||
Invalidate(aPresContext, nsRect(0,0,maxFrameWidth,maxFrameHeight));
|
||||
/*}*/
|
||||
|
|
|
@ -4630,7 +4630,16 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext,
|
|||
// has actually changed...
|
||||
/*if (eReflowReason_Incremental == aReflowState.reason ||
|
||||
eReflowReason_Dirty == aReflowState.reason) {*/
|
||||
maxFrameWidth = PR_MAX(maxFrameWidth, mRect.width);
|
||||
// XXX See bug 71523 We should really adjust the frames x coordinate to
|
||||
// a pixel boundary to solve this.
|
||||
// For now we add 1 pixel to the width of the invalidated rect.
|
||||
// This fixes cases where the twips to pixel roundoff causes the invalidated
|
||||
// rect's width to be one pixel short.
|
||||
float p2t;
|
||||
aPresContext->GetScaledPixelsToTwips(&p2t);
|
||||
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
|
||||
|
||||
maxFrameWidth = PR_MAX(maxFrameWidth, mRect.width) + onePixel;
|
||||
maxFrameHeight = PR_MAX(maxFrameHeight, mRect.height);
|
||||
Invalidate(aPresContext, nsRect(0,0,maxFrameWidth,maxFrameHeight));
|
||||
/*}*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче