The gaps should *not* be included in the space given to the item, and

so should also not be accounted for in the alignment adjustmanets


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28117 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-06-30 23:43:02 +00:00
parent 17b7cac5e8
commit 559b747dc0
2 changed files with 9 additions and 7 deletions

View File

@@ -1044,7 +1044,7 @@ wxSize wxGridSizer::CalcMin()
void wxGridSizer::SetItemBounds( wxSizerItem *item, int x, int y, int w, int h )
{
wxPoint pt( x,y );
wxSize sz( item->CalcMin() );
wxSize sz( item->GetMinSizeWithBorder() );
int flag = item->GetFlag();
if ((flag & wxEXPAND) || (flag & wxSHAPED))
@@ -1055,20 +1055,20 @@ void wxGridSizer::SetItemBounds( wxSizerItem *item, int x, int y, int w, int h )
{
if (flag & wxALIGN_CENTER_HORIZONTAL)
{
pt.x = x + (w - sz.x - m_hgap) / 2;
pt.x = x + (w - sz.x) / 2;
}
else if (flag & wxALIGN_RIGHT)
{
pt.x = x + (w - sz.x - m_hgap);
pt.x = x + (w - sz.x);
}
if (flag & wxALIGN_CENTER_VERTICAL)
{
pt.y = y + (h - sz.y - m_vgap) / 2;
pt.y = y + (h - sz.y) / 2;
}
else if (flag & wxALIGN_BOTTOM)
{
pt.y = y + (h - sz.y - m_vgap);
pt.y = y + (h - sz.y);
}
}