Layout margin on layout position rule.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2018-06-16 18:27:29 -03:00
parent 60c356efb1
commit 0446c4e19a

View File

@@ -73,18 +73,18 @@ void UIRelativeLayout::fixChildPos( UIWidget * widget ) {
switch ( widget->getLayoutPositionRule() ) {
case LEFT_OF:
pos.x = of->getPosition().x - widget->getSize().getWidth() - widget->getLayoutMargin().Right - of->getLayoutMargin().Left;
pos.y = of->getPosition().y;
pos.y = of->getPosition().y + widget->getLayoutMargin().Top;
break;
case RIGHT_OF:
pos.x = of->getPosition().x + of->getSize().getWidth() + widget->getLayoutMargin().Left + of->getLayoutMargin().Right;
pos.y = of->getPosition().y;
pos.y = of->getPosition().y + widget->getLayoutMargin().Top;
break;
case TOP_OF:
pos.x = of->getPosition().x;
pos.x = of->getPosition().x + widget->getLayoutMargin().Left;
pos.y = of->getPosition().y - widget->getSize().getHeight() - widget->getLayoutMargin().Bottom - of->getLayoutMargin().Top;
break;
case BOTTOM_OF:
pos.x = of->getPosition().x;
pos.x = of->getPosition().x + widget->getLayoutMargin().Left;
pos.y = of->getPosition().y + of->getSize().getHeight() + widget->getLayoutMargin().Top + of->getLayoutMargin().Bottom;
break;
default: