diff --git a/SDK/include/NDK/Widgets/ImageWidget.hpp b/SDK/include/NDK/Widgets/ImageWidget.hpp index fc36ca298..d95af8623 100644 --- a/SDK/include/NDK/Widgets/ImageWidget.hpp +++ b/SDK/include/NDK/Widgets/ImageWidget.hpp @@ -26,8 +26,6 @@ namespace Ndk //virtual ImageWidget* Clone() const = 0; - void ResizeToContent(); - inline const Nz::Color& GetColor() const; inline const Nz::TextureRef& GetTexture() const; inline const Nz::Rectf& GetTextureCoords() const; diff --git a/SDK/include/NDK/Widgets/LabelWidget.hpp b/SDK/include/NDK/Widgets/LabelWidget.hpp index aea711010..6e3b89ee8 100644 --- a/SDK/include/NDK/Widgets/LabelWidget.hpp +++ b/SDK/include/NDK/Widgets/LabelWidget.hpp @@ -32,8 +32,6 @@ namespace Ndk LabelWidget& operator=(LabelWidget&&) = default; private: - void Layout() override; - EntityHandle m_textEntity; Nz::TextSpriteRef m_textSprite; }; diff --git a/SDK/src/NDK/Widgets/CheckboxWidget.cpp b/SDK/src/NDK/Widgets/CheckboxWidget.cpp index 1bea0c9ce..7ea3969de 100644 --- a/SDK/src/NDK/Widgets/CheckboxWidget.cpp +++ b/SDK/src/NDK/Widgets/CheckboxWidget.cpp @@ -112,20 +112,16 @@ namespace Ndk { BaseWidget::Layout(); - Nz::Vector2f origin = Nz::Vector2f(0.f); Nz::Vector2f checkboxSize = GetCheckboxSize(); Nz::Vector2f borderSize = GetCheckboxBorderSize(); - m_checkboxBorderEntity->GetComponent().SetPosition(origin); - m_checkboxBackgroundEntity->GetComponent().SetPosition(origin + borderSize); + m_checkboxBackgroundEntity->GetComponent().SetPosition(borderSize); Nz::Vector3f checkboxBox = m_checkboxContentSprite->GetBoundingVolume().obb.localBox.GetLengths(); - m_checkboxContentEntity->GetComponent().SetPosition(origin.x + checkboxSize.x / 2.f - checkboxBox.x / 2.f, - origin.y + checkboxSize.y / 2.f - checkboxBox.y / 2.f); + m_checkboxContentEntity->GetComponent().SetPosition(checkboxSize.x / 2.f - checkboxBox.x / 2.f, checkboxSize.y / 2.f - checkboxBox.y / 2.f); Nz::Vector3f textBox = m_textSprite->GetBoundingVolume().obb.localBox.GetLengths(); - m_textEntity->GetComponent().SetPosition(origin.x + checkboxSize.x + (m_adaptativeMargin ? checkboxSize.x / 2.f : m_textMargin), - origin.y + checkboxSize.y / 2.f - textBox.y / 2.f); + m_textEntity->GetComponent().SetPosition(checkboxSize.x + (m_adaptativeMargin ? checkboxSize.x / 2.f : m_textMargin), checkboxSize.y / 2.f - textBox.y / 2.f); } void CheckboxWidget::OnMouseButtonRelease(int x, int y, Nz::Mouse::Button button) @@ -175,7 +171,7 @@ namespace Ndk Nz::Vector3f textSize = m_textSprite->GetBoundingVolume().obb.localBox.GetLengths(); Nz::Vector2f checkboxSize = GetCheckboxSize(); - Nz::Vector2f finalSize{ checkboxSize.x + (m_adaptativeMargin ? checkboxSize.x / 2.f : m_textMargin) + textSize.x, std::max(textSize.y, checkboxSize.y) }; + Nz::Vector2f finalSize { checkboxSize.x + (m_adaptativeMargin ? checkboxSize.x / 2.f : m_textMargin) + textSize.x, std::max(textSize.y, checkboxSize.y) }; SetMinimumSize(finalSize); SetPreferredSize(finalSize); } diff --git a/SDK/src/NDK/Widgets/LabelWidget.cpp b/SDK/src/NDK/Widgets/LabelWidget.cpp index 4c6553011..813295622 100644 --- a/SDK/src/NDK/Widgets/LabelWidget.cpp +++ b/SDK/src/NDK/Widgets/LabelWidget.cpp @@ -19,9 +19,4 @@ namespace Ndk Layout(); } - - void LabelWidget::Layout() - { - BaseWidget::Layout(); - } } diff --git a/SDK/src/NDK/Widgets/ProgressBarWidget.cpp b/SDK/src/NDK/Widgets/ProgressBarWidget.cpp index 3e2f01440..cc3f4f2d9 100644 --- a/SDK/src/NDK/Widgets/ProgressBarWidget.cpp +++ b/SDK/src/NDK/Widgets/ProgressBarWidget.cpp @@ -76,7 +76,6 @@ namespace Ndk void ProgressBarWidget::Layout() { - Nz::Vector2f origin = Nz::Vector2f(0.f); Nz::Vector2f size = GetSize(); Nz::Vector2f progressBarSize = size; @@ -85,7 +84,7 @@ namespace Ndk UpdateText(); Nz::Vector3f textSize = m_textSprite->GetBoundingVolume().obb.localBox.GetLengths(); - m_textEntity->GetComponent().SetPosition(origin.x + size.x - textSize.x, origin.y + size.y / 2.f - textSize.y); + m_textEntity->GetComponent().SetPosition(size.x - textSize.x, size.y / 2.f - textSize.y); progressBarSize -= { textSize.x + m_textMargin, 0.f }; } @@ -96,7 +95,6 @@ namespace Ndk m_barBackgroundSprite->SetSize(progressBarSize - (borderSize * 2.f)); m_barSprite->SetSize((progressBarSize.x - (borderSize.x * 2.f)) / 100.f * static_cast(m_value), progressBarSize.y - (borderSize.y * 2.f)); - m_borderEntity->GetComponent().SetPosition(origin.x, origin.y); - m_barEntity->GetComponent().SetPosition(origin.x + borderSize.x, origin.y + borderSize.y); + m_barEntity->GetComponent().SetPosition(borderSize.x, borderSize.y); } }