Sdk/Widgets: Properly fixes padding
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user