implemented ScrollBy
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12717 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Binary file not shown.
@@ -46,6 +46,11 @@ void Layer::ConvertToScreen2(BRect* rect)
|
||||
if (view)
|
||||
if (fParent)
|
||||
{
|
||||
rect->Set( rect->left - fOrigin.x,
|
||||
rect->top - fOrigin.y,
|
||||
rect->right - fOrigin.x,
|
||||
rect->bottom - fOrigin.y);
|
||||
|
||||
rect->Set( rect->left + fFrame.left,
|
||||
rect->top + fFrame.top,
|
||||
rect->right + fFrame.left,
|
||||
@@ -295,12 +300,32 @@ void Layer::ScrollBy(float dx, float dy)
|
||||
|
||||
if (!IsVisuallyHidden() && GetRootLayer())
|
||||
{
|
||||
// set the region to be invalidated.
|
||||
BRegion invalid(fFullVisible);
|
||||
|
||||
clear_visible_regions();
|
||||
|
||||
RebuildVisibleRegions(fFullVisible, VirtualBottomChild());
|
||||
rebuild_visible_regions(invalid, invalid, VirtualBottomChild());
|
||||
|
||||
// TODO: continue
|
||||
// for the moment we say that the whole surface needs to be redraw.
|
||||
BRegion redrawReg(fFullVisible);
|
||||
|
||||
// offset old region so that we can start comparing.
|
||||
invalid.OffsetBy(dx, dy);
|
||||
|
||||
// no need to redraw common regions. redraw only what's needed.
|
||||
redrawReg.Exclude(&invalid);
|
||||
|
||||
// compute the common region. we'll use HW acc to copy this to the new location.
|
||||
invalid.IntersectWith(&fFullVisible);
|
||||
|
||||
// offset back and instruct the driver to do the actual copying.
|
||||
invalid.OffsetBy(-dx, -dy);
|
||||
// TODO: HACK this!
|
||||
// GetDisplayDriver()->CopyRegion(&invalid, dx, dy);
|
||||
|
||||
GetRootLayer()->fRedrawReg.Include(&redrawReg);
|
||||
GetRootLayer()->RequestRedraw(); // TODO: what if we pass (fParent, startFromTHIS, &redrawReg)?
|
||||
}
|
||||
|
||||
if (dx != 0.0f || dy != 0.0f)
|
||||
|
||||
@@ -134,6 +134,10 @@ void clsMainWindow::test1()
|
||||
|
||||
lay2->ResizeBy(45,55);
|
||||
|
||||
snooze(2000000);
|
||||
|
||||
lay1->ScrollBy(0,50);
|
||||
|
||||
}
|
||||
|
||||
int main()
|
||||
|
||||
Reference in New Issue
Block a user