зеркало из https://github.com/mozilla/pjs.git
Fix bug 292914: if scrolling up more than 32767 pixels, window didn't refresh. Fix by just manually invalidating if scrolling will redraw the entire scrolled area. r=joshmoz, sr=jhpedemonte, a=bsmedberg.
This commit is contained in:
Родитель
5117a115c4
Коммит
d7b87c48e2
|
@ -1744,20 +1744,19 @@ nsWindow::ScrollBits ( Rect & inRectToScroll, PRInt32 inLeftDelta, PRInt32 inTop
|
|||
//-------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
|
||||
{
|
||||
|
||||
|
||||
if (mVisible && ContainerHierarchyIsVisible()) {
|
||||
nsRect scrollRect;
|
||||
|
||||
if (mVisible && ContainerHierarchyIsVisible())
|
||||
{
|
||||
// If the clipping region is non-rectangular, just force a full update, sorry.
|
||||
// XXX ?
|
||||
if (!IsRegionRectangular(mWindowRegion)) {
|
||||
if (!IsRegionRectangular(mWindowRegion))
|
||||
{
|
||||
Invalidate(PR_TRUE);
|
||||
goto scrollChildren;
|
||||
}
|
||||
|
||||
//--------
|
||||
// Scroll this widget
|
||||
nsRect scrollRect;
|
||||
if (aClipRect)
|
||||
scrollRect = *aClipRect;
|
||||
else
|
||||
|
@ -1766,10 +1765,17 @@ NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
|
|||
scrollRect.x = scrollRect.y = 0;
|
||||
}
|
||||
|
||||
// If we're scrolling by an amount that is larger than the height or
|
||||
// width, just invalidate the entire area.
|
||||
if (aDx >= scrollRect.width || aDy >= scrollRect.height)
|
||||
{
|
||||
Invalidate(scrollRect, PR_TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
Rect macRect;
|
||||
nsRectToMacRect(scrollRect, macRect);
|
||||
|
||||
|
||||
StartDraw();
|
||||
|
||||
// Clip to the windowRegion instead of the visRegion (note: the visRegion
|
||||
|
@ -1782,6 +1788,7 @@ NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
|
|||
|
||||
EndDraw();
|
||||
}
|
||||
}
|
||||
|
||||
scrollChildren:
|
||||
//--------
|
||||
|
|
Загрузка…
Ссылка в новой задаче