From 4a7973e335f247258a8e61c0e8541988d1807118 Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Fri, 10 Jun 2005 05:43:44 +0000 Subject: [PATCH] update git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13037 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../servers/app/newClipping/Clipping.proj | Bin 12308 -> 12308 bytes src/tests/servers/app/newClipping/Layer.cpp | 44 +++++++++++++----- src/tests/servers/app/newClipping/main.cpp | 6 ++- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/tests/servers/app/newClipping/Clipping.proj b/src/tests/servers/app/newClipping/Clipping.proj index 9a9b1e31c4a6f5ecbdb9d9dd7837130ea505a813..b87e60b2be5b92b06891c3e6bc143f529ce03fe2 100644 GIT binary patch delta 86 zcmbP|FePEb0XCL`H8Ks87w|f6W@Z1W!enE-Nk^Db^a29|0}Bu{12IDb5IZe@r8xPo fuG(Zj-I-#_mLOpuU;+^hKAu6XlbU2!G=5qT9$ delta 86 zcmbP|FePEb0X7ziIWi5C7w|f6W@Z1W!nCDvla4T>=m7=>1{NS@24aQ=AafResizeMode & 0x0000FFFF; + if ((rm & 0x0F0F) == (uint16)B_FOLLOW_LEFT_RIGHT || (rm & 0xF0F0) == (uint16)B_FOLLOW_TOP_BOTTOM) + { + + BRect oldBounds(lay->Bounds()); + oldBounds.right -=dx; + oldBounds.bottom -=dy; + + BRegion regZ(lay->Bounds()); + regZ.Include(oldBounds); + regZ.Exclude(oldBounds&lay->Bounds()); + + lay->ConvertToScreen2(®Z); + + reg.IntersectWith(&lay->fFullVisible); + + reg.Include(®Z); + + lay->rezize_layer_redraw_more(reg, dx, dy); +// above OR this: +// reg.Include(&lay->fFullVisible); + } + else if (((rm & 0x0F0F) == (uint16)B_FOLLOW_RIGHT && dx != 0) || ((rm & 0x0F0F) == (uint16)B_FOLLOW_H_CENTER && dx != 0) || ((rm & 0xF0F0) == (uint16)B_FOLLOW_BOTTOM && dy != 0)|| - ((rm & 0xF0F0) == (uint16)B_FOLLOW_V_CENTER && dy != 0) || - // TODO: these 2 don't need to be redrawn entirely. but ATM we don't have a choice - (rm & 0x0F0F) == (uint16)B_FOLLOW_LEFT_RIGHT || (rm & 0xF0F0) == (uint16)B_FOLLOW_TOP_BOTTOM) + ((rm & 0xF0F0) == (uint16)B_FOLLOW_V_CENTER && dy != 0)) { reg.Include(&lay->fFullVisible); } @@ -306,17 +326,20 @@ Layer::rezize_layer_redraw_more(BRegion &redraw, BRegion ©, float dx, float if ((rm & 0x0F0F) == (uint16)B_FOLLOW_RIGHT && dx != 0) { - copy.Include(&lay->fFullVisible); +// copy.Include(&lay->fFullVisible); redraw.Include(&lay->fFullVisible); } else if (((rm & 0x0F0F) == (uint16)B_FOLLOW_H_CENTER && dx != 0) || ((rm & 0xF0F0) == (uint16)B_FOLLOW_BOTTOM && dy != 0) || - ((rm & 0xF0F0) == (uint16)B_FOLLOW_V_CENTER && dy != 0) || - // TODO: these 2 don't need to be redrawn entirely. but ATM we don't have a choice - (rm & 0x0F0F) == (uint16)B_FOLLOW_LEFT_RIGHT || (rm & 0xF0F0) == (uint16)B_FOLLOW_TOP_BOTTOM) + ((rm & 0xF0F0) == (uint16)B_FOLLOW_V_CENTER && dy != 0)) { redraw.Include(&lay->fFullVisible); } + else if ((rm & 0x0F0F) == (uint16)B_FOLLOW_LEFT_RIGHT || (rm & 0xF0F0) == (uint16)B_FOLLOW_TOP_BOTTOM) + { + lay->rezize_layer_redraw_more(redraw, copy, dx, dy); +// redraw.Include(&lay->fFullVisible); + } } } @@ -339,9 +362,6 @@ Layer::ResizeBy(float dx, float dy) BRegion oldFullVisible(fFullVisible); BRegion oldVisible(fVisible); -// OPT: you can use HW acceleration for either for bottom alligned layer or -// for right alligned ones. investigate! - // right, center and bottom alligned layers will change their position // so we need to invalidate their current visible regions // BRegion redrawRightOrBottom; diff --git a/src/tests/servers/app/newClipping/main.cpp b/src/tests/servers/app/newClipping/main.cpp index a133be8909..d5402a49a3 100644 --- a/src/tests/servers/app/newClipping/main.cpp +++ b/src/tests/servers/app/newClipping/main.cpp @@ -139,8 +139,10 @@ void clsMainWindow::test1() c.green = rand()/256; c.blue = rand()/256; Layer *lay102 = new Layer(BRect(200,20,420,250), "lay102", - B_FOLLOW_NONE, - B_FULL_UPDATE_ON_RESIZE, c); +// B_FOLLOW_NONE, + B_FOLLOW_TOP_BOTTOM, +// B_FULL_UPDATE_ON_RESIZE, c); + 0, c); lay1->AddLayer(lay102); c.red = rand()/256;