Updates needed after encapsulation and harmonizing operators for LayoutLength 81/189681/3
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 19 Sep 2018 17:40:02 +0000 (18:40 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Mon, 24 Sep 2018 16:18:58 +0000 (16:18 +0000)
https://review.tizen.org/gerrit/#/c/189675/

Change-Id: Ib85562d7ddafcdc938ec766f3fee3b1ca4befb49

examples/simple-layout/custom-layout-impl.cpp

index 132c1fa..ecdb932 100644 (file)
@@ -66,8 +66,7 @@ void CustomLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top,
   LayoutLength childLeft( 0 );
 
   // We want to vertically align the children to the middle
-  LayoutLength height = bottom - top;
-  LayoutLength middle = height / 2;
+  LayoutLength middle = (bottom - top) / 2;
 
   // Horizontally align the children to the middle of the space they are given too
   LayoutLength width = right - left;
@@ -90,7 +89,7 @@ void CustomLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top,
       LayoutLength childWidth = childLayout->GetMeasuredWidth();
       LayoutLength childHeight = childLayout->GetMeasuredHeight();
 
-      childTop = middle - (childHeight / 2);
+      childTop = middle - childHeight / 2;
 
       LayoutLength left = childLeft + center - childWidth / 2;