feat(ui): support scaling of labels and images

Modify width() and height() methods to multiply by m_scale for both Label and Image. Rename internal dimensions to m_real_width and m_real_height for clarity. Adjust Button foreground position to vertically center when label is scaled.
This commit is contained in:
2026-07-13 11:40:27 +08:00
parent b5e0bb9290
commit 1fa3b9cce8
5 changed files with 10 additions and 9 deletions

View File

@@ -36,8 +36,8 @@ protected:
private:
TextStyle m_text;
UIVertexData m_data;
float m_width = 0.0f;
float m_height = 0.0f;
float m_real_width = 0.0f;
float m_real_height = 0.0f;
float m_offset_x = 0.0f;
float m_offset_y = 0.0f;
void update_vertices();