From 60d5a3fc59fca9841fb76f592701b3d33e86e398 Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Sun, 29 May 2005 20:58:27 +0000 Subject: [PATCH] fixed the clipping bug I was talking in my previous checkin. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12898 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../servers/app/newClipping/Clipping.proj | Bin 12308 -> 12308 bytes src/tests/servers/app/newClipping/Layer.cpp | 8 ++++++++ src/tests/servers/app/newClipping/main.cpp | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tests/servers/app/newClipping/Clipping.proj b/src/tests/servers/app/newClipping/Clipping.proj index 1ebb697a9bea53d77f58cb73026a3228c8612697..37bc87d83b4f45785af5c1d02ed46a99ea4f6d1e 100644 GIT binary patch delta 90 zcmbP|FePEb0XCL|NU4U&3wRwjv$FqGVV=USxS3H$m62)ty~%%d)h7Gt&J>fAWPkuB g5Y+(0PP2CG1WK=A+TI9Oby05<)AlAXbG3dZ05C8f(*OVf delta 90 zcmbP|FePEb0XCKk{W1-c7w|f6W@Z1W!W=VMWiz9WDkD?TrOAJF)h7Gt&J>fq%K!mP hAgTd~oo40c0;Sh5fho1g7xgwV6@o<6Ca>1d1ORd>9`pbJ diff --git a/src/tests/servers/app/newClipping/Layer.cpp b/src/tests/servers/app/newClipping/Layer.cpp index 3d3b40c3ce..22de7680e5 100644 --- a/src/tests/servers/app/newClipping/Layer.cpp +++ b/src/tests/servers/app/newClipping/Layer.cpp @@ -501,6 +501,7 @@ void Layer::rebuild_visible_regions(const BRegion &invalid, // intersect maximum wanted region with the invalid region BRegion common; set_user_regions(common); + common.IntersectWith(&invalid); // if the resulted region is not valid, this layer is not in the catchment area // of the region being invalidated @@ -514,6 +515,11 @@ void Layer::rebuild_visible_regions(const BRegion &invalid, { // we have something to include to our fullVisible. It may already be in // there, but we'll never know. + +// TODO: further analyze the next 2 lines. + fFullVisible.Exclude(&invalid); + fVisible.Exclude(&invalid); + fFullVisible.Include(&common); } else @@ -585,6 +591,8 @@ void Layer::clear_visible_regions() void Layer::PrintToStream() const { printf("-> %s\n", fName); + fVisible.PrintToStream(); + fFullVisible.PrintToStream(); for (Layer *child = VirtualBottomChild(); child; child = VirtualUpperSibling()) child->PrintToStream(); diff --git a/src/tests/servers/app/newClipping/main.cpp b/src/tests/servers/app/newClipping/main.cpp index ed2852a9c5..e07fdad1c0 100644 --- a/src/tests/servers/app/newClipping/main.cpp +++ b/src/tests/servers/app/newClipping/main.cpp @@ -118,7 +118,7 @@ void clsMainWindow::test1() c.red = rand()/256; c.green = rand()/256; c.blue = rand()/256; - Layer *lay12 = new Layer(BRect(170,20,290,150), "lay21", + Layer *lay12 = new Layer(BRect(170,20,290,150), "lay12", B_FOLLOW_NONE, B_FULL_UPDATE_ON_RESIZE, c); lay1->AddLayer(lay12); @@ -126,7 +126,7 @@ void clsMainWindow::test1() c.red = rand()/256; c.green = rand()/256; c.blue = rand()/256; - Layer *lay13 = new Layer(BRect(20,20,100,100), "lay31", + Layer *lay13 = new Layer(BRect(20,20,100,100), "lay13", B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, 0, c); lay12->AddLayer(lay13);