Skip to content

Commit

Permalink
修正水平和垂直布局的最后一个子控件padding计算错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
miaoqing.wmq committed May 9, 2016
1 parent 8259397 commit 45096ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions DuiLib/Layout/UIHorizontalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ namespace DuiLib
if( sz.cx == 0 ) {
iAdjustable++;
sz.cx = cxExpand;
cxFixedRemaining = cxFixedRemaining - (rcPadding.left + rcPadding.right);
// Distribute remaining to last element (usually round-off left-overs)
if( iAdjustable == nAdjustables ) {
sz.cx = MAX(0, szRemaining.cx - rcPadding.right - cxFixedRemaining);
Expand Down
1 change: 1 addition & 0 deletions DuiLib/Layout/UIVerticalLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ namespace DuiLib
if( sz.cy == 0 ) {
iAdjustable++;
sz.cy = cyExpand;
cyFixedRemaining = cyFixedRemaining - (rcPadding.top + rcPadding.bottom);
// Distribute remaining to last element (usually round-off left-overs)
if( iAdjustable == nAdjustables ) {
sz.cy = MAX(0, szRemaining.cy - rcPadding.bottom - cyFixedRemaining);
Expand Down

0 comments on commit 45096ae

Please sign in to comment.