Skip to content

Commit

Permalink
Update GUI layout bottom/right
Browse files Browse the repository at this point in the history
  • Loading branch information
ducphamhong committed Aug 21, 2024
1 parent b81a018 commit ea15014
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ namespace Skylicht
t->m_transformPosition.Y = parentRect.UpperLeftCorner.Y + (parentRect.getHeight() - t->Rect.getHeight()) * 0.5f + t->m_position.Y;
break;
case EGUIVerticalAlign::Bottom:
t->m_transformPosition.Y = parentRect.LowerRightCorner.Y - t->Rect.getHeight() - t->m_position.Y;
t->m_transformPosition.Y = parentRect.LowerRightCorner.Y - t->Rect.getHeight() + t->m_position.Y;
break;
default:
break;
Expand All @@ -215,7 +215,7 @@ namespace Skylicht
t->m_transformPosition.X = parentRect.UpperLeftCorner.X + (parentRect.getWidth() - t->Rect.getWidth()) * 0.5f + t->m_position.X;
break;
case EGUIHorizontalAlign::Right:
t->m_transformPosition.X = parentRect.LowerRightCorner.X - t->Rect.getWidth() - t->m_position.X;
t->m_transformPosition.X = parentRect.LowerRightCorner.X - t->Rect.getWidth() + t->m_position.X;
break;
default:
break;
Expand Down
4 changes: 2 additions & 2 deletions Samples/LuckyDraw/Source/CViewDemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,10 @@ void CViewDemo::onInit()
float leftW = btnLeft->getWidth();
float leftH = btnLeft->getHeight();
core::rectf leftBtnSize(0.0f, 0.0f, leftW, leftH);
buttonY = 20.0f;
buttonY = -20.0f;

#if defined(IOS)
buttonY = 100.0f;
buttonY = -100.0f;
#endif

CGUIElement* buttonLeftGUI = m_canvas->createElement(leftBtnSize);
Expand Down

0 comments on commit ea15014

Please sign in to comment.