Commit 4882639ded20a2b1f41fa63b1d68950f9f918e6d
Committed by
Gerrit Code Review
Merge "Updates needed after encapsulation and harmonizing operators for LayoutLe…
…ngth" into devel/master
Showing
1 changed file
with
2 additions
and
3 deletions
examples/simple-layout/custom-layout-impl.cpp
| @@ -66,8 +66,7 @@ void CustomLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top, | @@ -66,8 +66,7 @@ void CustomLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top, | ||
| 66 | LayoutLength childLeft( 0 ); | 66 | LayoutLength childLeft( 0 ); |
| 67 | 67 | ||
| 68 | // We want to vertically align the children to the middle | 68 | // We want to vertically align the children to the middle |
| 69 | - LayoutLength height = bottom - top; | ||
| 70 | - LayoutLength middle = height / 2; | 69 | + LayoutLength middle = (bottom - top) / 2; |
| 71 | 70 | ||
| 72 | // Horizontally align the children to the middle of the space they are given too | 71 | // Horizontally align the children to the middle of the space they are given too |
| 73 | LayoutLength width = right - left; | 72 | LayoutLength width = right - left; |
| @@ -90,7 +89,7 @@ void CustomLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top, | @@ -90,7 +89,7 @@ void CustomLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top, | ||
| 90 | LayoutLength childWidth = childLayout->GetMeasuredWidth(); | 89 | LayoutLength childWidth = childLayout->GetMeasuredWidth(); |
| 91 | LayoutLength childHeight = childLayout->GetMeasuredHeight(); | 90 | LayoutLength childHeight = childLayout->GetMeasuredHeight(); |
| 92 | 91 | ||
| 93 | - childTop = middle - (childHeight / 2); | 92 | + childTop = middle - childHeight / 2; |
| 94 | 93 | ||
| 95 | LayoutLength left = childLeft + center - childWidth / 2; | 94 | LayoutLength left = childLeft + center - childWidth / 2; |
| 96 | 95 |