From 285d5ce2eafd806089e8ee516fbac3470b773e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 23 Apr 2007 22:05:14 +0000 Subject: [PATCH] we need view bounds in the window coordinates, they can then be offset with the window bounds for clipping git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20785 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/opengl/GLView.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/kits/opengl/GLView.cpp b/src/kits/opengl/GLView.cpp index a2b0cb6c2f..8907ef971d 100644 --- a/src/kits/opengl/GLView.cpp +++ b/src/kits/opengl/GLView.cpp @@ -158,6 +158,10 @@ BGLView::AttachedToWindow() { BView::AttachedToWindow(); + m_bounds = Bounds(); + for (BView *v = this; v; v = v->Parent()) + v->ConvertToParent(&m_bounds); + fRenderer = fRoster->GetRenderer(); if (fRenderer) { // Don't paint white window background when resized @@ -205,7 +209,10 @@ BGLView::AllDetached() void BGLView::FrameResized(float width, float height) { - m_bounds.Set(0, 0, width, height); + m_bounds = Bounds(); + for (BView *v = this; v; v = v->Parent()) + v->ConvertToParent(&m_bounds); + if (fRenderer) fRenderer->FrameResized(width, height); @@ -311,7 +318,7 @@ BGLView::DirectConnected(direct_buffer_info *info) // TODO: I have the feeling that this Bounds() call won't work here. // Probably m_bounds should be used, but it should then be maintained correctly // on view resizing/moving... - BRegion boundsRegion = Bounds(); + BRegion boundsRegion = m_bounds.OffsetByCopy(localInfo->window_bounds.left, localInfo->window_bounds.top); region.IntersectWith(&boundsRegion); localInfo->clip_list_count = region.CountRects();