From: Stefan Csomor Date: Tue, 13 Aug 2002 06:55:48 +0000 (+0000) Subject: corrected internal window position after a zoom operation X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/0f4930939e18a6c07ef303533329dd5334a65780 corrected internal window position after a zoom operation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/app.cpp b/src/mac/app.cpp index 3828e3612f..248cfa19d6 100644 --- a/src/mac/app.cpp +++ b/src/mac/app.cpp @@ -1516,7 +1516,7 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr ) newWidth = oldWidth; if (newHeight == 0) newHeight = oldHeight; - win->SetSize( -1, -1, newWidth, newHeight, wxSIZE_USE_EXISTING); + win->SetSize( -1, -1 , newWidth, newHeight, wxSIZE_USE_EXISTING); } } s_lastMouseDown = 0; @@ -1531,9 +1531,15 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr ) if (win) { Rect tempRect ; + GrafPtr port ; + GetPort( &port ) ; + Point pt = { 0, 0 } ; + SetPortWindowPort(window) ; + LocalToGlobal( &pt ) ; + SetPort( port ) ; GetWindowPortBounds(window, &tempRect ) ; - win->SetSize( -1, -1, tempRect.right-tempRect.left , + win->SetSize( pt.h , pt.v , tempRect.right-tempRect.left , tempRect.bottom-tempRect.top, wxSIZE_USE_EXISTING); } } diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 3828e3612f..248cfa19d6 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -1516,7 +1516,7 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr ) newWidth = oldWidth; if (newHeight == 0) newHeight = oldHeight; - win->SetSize( -1, -1, newWidth, newHeight, wxSIZE_USE_EXISTING); + win->SetSize( -1, -1 , newWidth, newHeight, wxSIZE_USE_EXISTING); } } s_lastMouseDown = 0; @@ -1531,9 +1531,15 @@ void wxApp::MacHandleMouseDownEvent( WXEVENTREF evr ) if (win) { Rect tempRect ; + GrafPtr port ; + GetPort( &port ) ; + Point pt = { 0, 0 } ; + SetPortWindowPort(window) ; + LocalToGlobal( &pt ) ; + SetPort( port ) ; GetWindowPortBounds(window, &tempRect ) ; - win->SetSize( -1, -1, tempRect.right-tempRect.left , + win->SetSize( pt.h , pt.v , tempRect.right-tempRect.left , tempRect.bottom-tempRect.top, wxSIZE_USE_EXISTING); } }