From 00f553943850592fda4607bf8a34d458cf6ab522 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 8 Feb 2004 11:07:23 +0000 Subject: [PATCH] scroll of subwindow confined to rect param git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25609 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 11 ++++++++++- src/mac/window.cpp | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index bfff87c13d..8fad9699bc 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -1278,7 +1278,16 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) child->GetPosition( &x, &y ); int w,h; child->GetSize( &w, &h ); - child->SetSize( x+dx, y+dy, w, h ); + if (rect) + { + wxRect rc(x,y,w,h); + if (rect->Intersects(rc)) + child->SetSize( x+dx, y+dy, w, h ); + } + else + { + child->SetSize( x+dx, y+dy, w, h ); + } } Update() ; diff --git a/src/mac/window.cpp b/src/mac/window.cpp index bfff87c13d..8fad9699bc 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -1278,7 +1278,16 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) child->GetPosition( &x, &y ); int w,h; child->GetSize( &w, &h ); - child->SetSize( x+dx, y+dy, w, h ); + if (rect) + { + wxRect rc(x,y,w,h); + if (rect->Intersects(rc)) + child->SetSize( x+dx, y+dy, w, h ); + } + else + { + child->SetSize( x+dx, y+dy, w, h ); + } } Update() ; -- 2.49.0