From 55a88f0c29c97fd028fd1e4dbd57b01f6c286893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 29 Mar 2009 18:20:00 +0000 Subject: [PATCH] When a view has B_DRAW_ON_CHILDREN set, do not ignore the user clipping when painting the background. The user may have set that on purpose. For regular views, it doesn't really make sense to use the user clipping for painting the background, since there is no way these parts could ever be painted at all. In Draw() there will be a new view state on the stack, so the client has no way to unset the clipping. On the other hand, there may be useful cases where the user applied a clipping, and wants itself not drawing outside of it, but does want the background painted. (For example BTextView::SetTextRect() may use this in the future.) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29790 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/View.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/servers/app/View.cpp b/src/servers/app/View.cpp index 193bdad2e7..6fdcb3fa45 100644 --- a/src/servers/app/View.cpp +++ b/src/servers/app/View.cpp @@ -1316,8 +1316,17 @@ View::Draw(DrawingEngine* drawingEngine, BRegion* effectiveClipping, if (fViewBitmap != NULL || fViewColor != B_TRANSPARENT_COLOR) { // we can only draw within our own area - BRegion* redraw = fWindow->GetRegion( - _ScreenClipping(windowContentClipping)); + BRegion* redraw; + if ((fFlags & B_DRAW_ON_CHILDREN) != 0) { + // The client may actually want to prevent the background to + // be painted outside the user clipping. + redraw = fWindow->GetRegion( + ScreenAndUserClipping(windowContentClipping)); + } else { + // Ignore user clipping as in BeOS for painting the background. + redraw = fWindow->GetRegion( + _ScreenClipping(windowContentClipping)); + } if (!redraw) return; // add the current clipping