Core/Node: Refactor interface

- Removed overloads taking multiple scalars
- Removed CoordSys parameter (functions exists in two sets, local and global)
This commit is contained in:
SirLynix
2024-02-18 22:16:54 +01:00
committed by Jérôme Leclercq
parent 194dba5002
commit 63c526cecc
23 changed files with 444 additions and 462 deletions

View File

@@ -54,7 +54,7 @@ namespace Nz
Vector2f parentSize = m_parentWidget->GetSize();
Vector2f mySize = GetSize();
SetPosition((parentSize.x - mySize.x) / 2.f, (parentSize.y - mySize.y) / 2.f);
SetPosition({ (parentSize.x - mySize.x) / 2.f, (parentSize.y - mySize.y) / 2.f });
}
inline void BaseWidget::CenterHorizontal()
@@ -63,7 +63,7 @@ namespace Nz
Vector2f parentSize = m_parentWidget->GetSize();
Vector2f mySize = GetSize();
SetPosition((parentSize.x - mySize.x) / 2.f, GetPosition(CoordSys::Local).y);
SetPosition({ (parentSize.x - mySize.x) / 2.f, GetPosition().y });
}
inline void BaseWidget::CenterVertical()
@@ -72,7 +72,7 @@ namespace Nz
Vector2f parentSize = m_parentWidget->GetSize();
Vector2f mySize = GetSize();
SetPosition(GetPosition(CoordSys::Local).x, (parentSize.y - mySize.y) / 2.f);
SetPosition({ GetPosition().x, (parentSize.y - mySize.y) / 2.f });
}
inline void BaseWidget::ClearRenderingRect()

View File

@@ -65,7 +65,7 @@ namespace Nz
{
WidgetEntry& entry = m_widgetEntries[index];
Nz::Vector3f pos = entry.widget->GetPosition(Nz::CoordSys::Global);
Nz::Vector3f pos = entry.widget->GetGlobalPosition();
Nz::Vector2f size = entry.widget->GetSize();
entry.box = Boxf(pos.x, pos.y, pos.z, size.x, size.y, 1.f);