From 2e8bd797742fe5d430b9148e67375a668b3f939d Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Wed, 15 Jun 2005 16:20:40 +0000 Subject: [PATCH] all view that have B_FULL_UPDATE_ON_RESIZE flag set invalidate their visible area now. not just the one being resized. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13153 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../servers/app/newClipping/Clipping.proj | Bin 12308 -> 12308 bytes src/tests/servers/app/newClipping/Layer.cpp | 26 ++++++++++++------ src/tests/servers/app/newClipping/Layer.h | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/tests/servers/app/newClipping/Clipping.proj b/src/tests/servers/app/newClipping/Clipping.proj index 3cd3eee6dd414fdc444e76dc94d211c7e8c54530..d5cecc18bf9e9b14069cb9cf0e49f1ae8ab770fa 100644 GIT binary patch delta 111 zcmbP|FePEb0XCKs8)X_MFW`0D%*y^#h1q1c@@7UI6-MR__ufzbtE)EIPj{x6tS18m mFoCEBAa>gDpaLkp8m{c3-h9#5KnV>XMpAX}1K5z&`k4S@MI~SW delta 111 zcmbP|FePEb0X7zgNiq$S7w|f6W@Z1W!mPs}vzbvxg^_vvzKxUr>Z(ol)14`%Fp~iS mm_Sqm5Ie2E90QbI4OeziZ@%bhpo9hxBdOZA32ew}{Y(J0;v(As diff --git a/src/tests/servers/app/newClipping/Layer.cpp b/src/tests/servers/app/newClipping/Layer.cpp index 411a1027a9..254e59bf1d 100644 --- a/src/tests/servers/app/newClipping/Layer.cpp +++ b/src/tests/servers/app/newClipping/Layer.cpp @@ -276,7 +276,7 @@ Layer::resize_layer_frame_by(float x, float y) } } -void +inline void Layer::rezize_layer_redraw_more(BRegion ®, float dx, float dy) { if (dx == 0 && dy == 0) @@ -329,20 +329,29 @@ Layer::rezize_layer_redraw_more(BRegion ®, float dx, float dy) } } } -/* + inline void Layer::resize_layer_full_update_on_resize(BRegion ®, float dx, float dy) { if (dx == 0 && dy == 0) return; - if (flags & B_FULL_UPDATE_ON_RESIZE && fVisible.CountRects() > 0) - reg.Include(&fVisible); - for (Layer *lay = VirtualBottomChild(); lay; lay = VirtualUpperSibling()) - lay->resize_layer_full_update_on_resize(); + { + uint16 rm = lay->fResizeMode & 0x0000FFFF; + + if ((rm & 0x0F0F) == (uint16)B_FOLLOW_LEFT_RIGHT || (rm & 0xF0F0) == (uint16)B_FOLLOW_TOP_BOTTOM) + { + if (lay->fFlags & B_FULL_UPDATE_ON_RESIZE && lay->fVisible.CountRects() > 0) + reg.Include(&lay->fVisible); + + lay->resize_layer_full_update_on_resize(reg, + (rm & 0x0F0F) == (uint16)B_FOLLOW_LEFT_RIGHT? dx: 0, + (rm & 0xF0F0) == (uint16)B_FOLLOW_TOP_BOTTOM? dy: 0); + } + } } -*/ + void Layer::ResizeBy(float dx, float dy) { @@ -399,7 +408,8 @@ Layer::ResizeBy(float dx, float dy) // include layer's visible region in case we want a full update on resize if (fFlags & B_FULL_UPDATE_ON_RESIZE && fVisible.Frame().IsValid()) { -// TODO: fFlags & B_FULL_UPDATE_ON_RESIZE - do that for descendants. + resize_layer_full_update_on_resize(GetRootLayer()->fRedrawReg, dx, dy); + GetRootLayer()->fRedrawReg.Include(&fVisible); GetRootLayer()->fRedrawReg.Include(&oldVisible); } diff --git a/src/tests/servers/app/newClipping/Layer.h b/src/tests/servers/app/newClipping/Layer.h index b73cff960c..9d105d56aa 100644 --- a/src/tests/servers/app/newClipping/Layer.h +++ b/src/tests/servers/app/newClipping/Layer.h @@ -73,6 +73,7 @@ private: void clear_visible_regions(); void resize_layer_frame_by(float x, float y); void rezize_layer_redraw_more(BRegion ®, float dx, float dy); + void resize_layer_full_update_on_resize(BRegion ®, float dx, float dy); char fName[50]; BRegion fVisible;