Skip to content

Commit

Permalink
修复padding属性导致自动计算宽高度错误的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
redrains committed Jan 20, 2015
1 parent 8692be9 commit 4f409c8
Show file tree
Hide file tree
Showing 19 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion DuiLib/Layout/UIHorizontalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ namespace DuiLib
if( sz.cx < pControl->GetMinWidth() ) sz.cx = pControl->GetMinWidth();
if( sz.cx > pControl->GetMaxWidth() ) sz.cx = pControl->GetMaxWidth();

cxFixedRemaining -= (sz.cx + rcPadding.left + rcPadding.right + m_iChildPadding);
cxFixedRemaining -= sz.cx + rcPadding.left + rcPadding.right ;
}

cxFixedRemaining -= m_iChildPadding;

sz.cy = pControl->GetFixedHeight();
if( sz.cy == 0 ) sz.cy = rc.bottom - rc.top - rcPadding.top - rcPadding.bottom;
if( sz.cy < 0 ) sz.cy = 0;
Expand Down
4 changes: 3 additions & 1 deletion DuiLib/Layout/UIVerticalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ namespace DuiLib
else {
if( sz.cy < pControl->GetMinHeight() ) sz.cy = pControl->GetMinHeight();
if( sz.cy > pControl->GetMaxHeight() ) sz.cy = pControl->GetMaxHeight();
cyFixedRemaining -= (sz.cy + rcPadding.top + rcPadding.bottom + m_iChildPadding);
cyFixedRemaining -= sz.cy + rcPadding.top + rcPadding.bottom + m_iChildPadding;
}

cyFixedRemaining -= m_iChildPadding;

sz.cx = pControl->GetFixedWidth();
if( sz.cx == 0 ) sz.cx = szAvailable.cx - rcPadding.left - rcPadding.right;
if( sz.cx < 0 ) sz.cx = 0;
Expand Down
Binary file modified Lib2008/DuiLib_u.lib
Binary file not shown.
Binary file modified Lib2008/DuiLib_ud.lib
Binary file not shown.
Binary file modified Lib2008/UiLib_u.lib
Binary file not shown.
Binary file modified Lib2008/UiLib_ud.lib
Binary file not shown.
4 changes: 3 additions & 1 deletion UiLib/Layout/UIHorizontalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ namespace UiLib
if( sz.cx < pControl->GetMinWidth() ) sz.cx = pControl->GetMinWidth();
if( sz.cx > pControl->GetMaxWidth() ) sz.cx = pControl->GetMaxWidth();

cxFixedRemaining -= (sz.cx + rcPadding.left + rcPadding.right + m_iChildPadding);
cxFixedRemaining -= sz.cx + rcPadding.left + rcPadding.right ;
}

cxFixedRemaining -= m_iChildPadding;

sz.cy = pControl->GetFixedHeight();
if( sz.cy == 0 ) sz.cy = rc.bottom - rc.top - rcPadding.top - rcPadding.bottom;
if( sz.cy < 0 ) sz.cy = 0;
Expand Down
4 changes: 3 additions & 1 deletion UiLib/Layout/UIVerticalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ namespace UiLib
else {
if( sz.cy < pControl->GetMinHeight() ) sz.cy = pControl->GetMinHeight();
if( sz.cy > pControl->GetMaxHeight() ) sz.cy = pControl->GetMaxHeight();
cyFixedRemaining -= (sz.cy + rcPadding.top + rcPadding.bottom + m_iChildPadding);
cyFixedRemaining -= sz.cy + rcPadding.top + rcPadding.bottom + m_iChildPadding;
}

cyFixedRemaining -= m_iChildPadding;

sz.cx = pControl->GetFixedWidth();
if( sz.cx == 0 ) sz.cx = szAvailable.cx - rcPadding.left - rcPadding.right;
if( sz.cx < 0 ) sz.cx = 0;
Expand Down
Binary file modified dll/DuiLib_u.dll
Binary file not shown.
Binary file modified dll/DuiLib_ud.dll
Binary file not shown.
Binary file modified dll/UiLib_u.dll
Binary file not shown.
Binary file modified dll/UiLib_ud.dll
Binary file not shown.
Binary file modified dll2008/DuiLib_u.dll
Binary file not shown.
Binary file modified dll2008/DuiLib_ud.dll
Binary file not shown.
Binary file modified dll2008/UiLib_u.dll
Binary file not shown.
Binary file modified dll2008/UiLib_ud.dll
Binary file not shown.
Binary file modified lib/DuiLib_u.lib
Binary file not shown.
Binary file modified lib/DuiLib_ud.lib
Binary file not shown.
Binary file modified lib/Uilib_u.lib
Binary file not shown.

0 comments on commit 4f409c8

Please sign in to comment.