Skip to content

Commit

Permalink
修复水平和垂直布局在某些情况下布局不正确的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
miaoqing.wmq committed May 20, 2016
1 parent 770ef15 commit f69dc9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion DuiLib/Layout/UIHorizontalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ namespace DuiLib
if (iControlMaxHeight <= 0) iControlMaxHeight = pControl->GetMaxHeight();
if (szControlAvailable.cx > iControlMaxWidth) szControlAvailable.cx = iControlMaxWidth;
if (szControlAvailable.cy > iControlMaxHeight) szControlAvailable.cy = iControlMaxHeight;
if (iEstimate > 1) cxFixedRemaining = cxFixedRemaining - (rcPadding.left + rcPadding.right) - m_iChildPadding;
cxFixedRemaining = cxFixedRemaining - (rcPadding.left + rcPadding.right);
if (iEstimate > 1) cxFixedRemaining = cxFixedRemaining - m_iChildPadding;
SIZE sz = pControl->EstimateSize(szControlAvailable);
if (pControl->GetFixedWidth() == 0 || sz.cx == 0) {
iAdjustable++;
Expand Down
3 changes: 2 additions & 1 deletion DuiLib/Layout/UIVerticalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ namespace DuiLib
if (iControlMaxHeight <= 0) iControlMaxHeight = pControl->GetMaxHeight();
if (szControlAvailable.cx > iControlMaxWidth) szControlAvailable.cx = iControlMaxWidth;
if (szControlAvailable.cy > iControlMaxHeight) szControlAvailable.cy = iControlMaxHeight;
if (iEstimate > 1) cyFixedRemaining = cyFixedRemaining - (rcPadding.top + rcPadding.bottom) - m_iChildPadding;
cyFixedRemaining = cyFixedRemaining - (rcPadding.top + rcPadding.bottom);
if (iEstimate > 1) cyFixedRemaining = cyFixedRemaining - m_iChildPadding;
SIZE sz = pControl->EstimateSize(szControlAvailable);
if( sz.cy == 0 ) {
iAdjustable++;
Expand Down

0 comments on commit f69dc9f

Please sign in to comment.