fix bugs in the last changes to min and max size handling, fixes #9947
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -837,19 +837,24 @@ wxNonOwnedWindowEventHandler(EventHandlerCallRef WXUNUSED(handler),
|
|||||||
if ( (attributes & kWindowBoundsChangeSizeChanged) || (attributes & kWindowBoundsChangeOriginChanged) )
|
if ( (attributes & kWindowBoundsChangeSizeChanged) || (attributes & kWindowBoundsChangeOriginChanged) )
|
||||||
{
|
{
|
||||||
// all (Mac) rects are in content area coordinates, all wxRects in structure coordinates
|
// all (Mac) rects are in content area coordinates, all wxRects in structure coordinates
|
||||||
int left , top , right , bottom ;
|
int left , top , width , height ;
|
||||||
|
// structure width
|
||||||
toplevelWindow->GetNonOwnedPeer()->GetContentArea(left, top, right, bottom);
|
int swidth, sheight;
|
||||||
|
|
||||||
|
toplevelWindow->GetNonOwnedPeer()->GetContentArea(left, top, width, height);
|
||||||
|
toplevelWindow->GetNonOwnedPeer()->GetSize(swidth, sheight);
|
||||||
|
int deltawidth = swidth - width;
|
||||||
|
int deltaheight = sheight - height;
|
||||||
wxRect adjustR(
|
wxRect adjustR(
|
||||||
newRect.left - left,
|
newRect.left - left,
|
||||||
newRect.top - top,
|
newRect.top - top,
|
||||||
newRect.right - newRect.left + left + right,
|
newRect.right - newRect.left + deltawidth,
|
||||||
newRect.bottom - newRect.top + top + bottom ) ;
|
newRect.bottom - newRect.top + deltaheight ) ;
|
||||||
|
|
||||||
toplevelWindow->HandleResizing( cEvent.GetTicks(), &adjustR );
|
toplevelWindow->HandleResizing( cEvent.GetTicks(), &adjustR );
|
||||||
|
|
||||||
const Rect adjustedRect = { adjustR.y + top , adjustR.x + left , adjustR.y + adjustR.height - bottom , adjustR.x + adjustR.width - right } ;
|
const Rect adjustedRect = { adjustR.y + top , adjustR.x + left , adjustR.y + top + adjustR.height - deltaheight ,
|
||||||
|
adjustR.x + left + adjustR.width - deltawidth } ;
|
||||||
if ( !EqualRect( &newRect , &adjustedRect ) )
|
if ( !EqualRect( &newRect , &adjustedRect ) )
|
||||||
cEvent.SetParameter<Rect>( kEventParamCurrentBounds , &adjustedRect ) ;
|
cEvent.SetParameter<Rect>( kEventParamCurrentBounds , &adjustedRect ) ;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user