Sdk/Widgets: Properly fixes padding

This commit is contained in:
Lynix
2017-01-18 23:06:31 +01:00
parent 5752792565
commit c1dfc5c4b8
7 changed files with 44 additions and 34 deletions

View File

@@ -46,6 +46,7 @@ namespace Ndk
inline const Nz::Color& GetBackgroundColor() const;
inline Canvas* GetCanvas();
inline const Padding& GetPadding() const;
inline Nz::Vector2f GetContentOrigin() const;
inline const Nz::Vector2f& GetContentSize() const;
inline Nz::Vector2f GetSize() const;

View File

@@ -60,6 +60,11 @@ namespace Ndk
return m_padding;
}
inline Nz::Vector2f BaseWidget::GetContentOrigin() const
{
return { m_padding.left, m_padding.top };
}
inline const Nz::Vector2f& BaseWidget::GetContentSize() const
{
return m_contentSize;

View File

@@ -57,7 +57,7 @@ namespace Ndk
TextAreaWidget& operator=(TextAreaWidget&&) = default;
private:
void RefreshCursor();
void Layout() override;
void OnKeyPressed(const Nz::WindowEvent::KeyEvent& key) override;
void OnKeyReleased(const Nz::WindowEvent::KeyEvent& key) override;
@@ -67,6 +67,8 @@ namespace Ndk
void OnMouseExit() override;
void OnTextEntered(char32_t character, bool repeated) override;
void RefreshCursor();
EntityHandle m_cursorEntity;
EntityHandle m_textEntity;
Nz::SimpleTextDrawer m_drawer;