feat(ui): add CSimpleFontString::SetHeight and CSimpleFontString::SetWidth

This commit is contained in:
fallenoak 2025-12-04 15:45:43 -06:00
parent 4aa67fc3dc
commit 1c8e6262ca
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 16 additions and 0 deletions

View File

@ -702,6 +702,13 @@ int32_t CSimpleFontString::SetFont(const char* fontName, float fontHeight, uint3
return 1; return 1;
} }
void CSimpleFontString::SetHeight(float height) {
this->CLayoutFrame::SetHeight(height);
this->m_cachedWidth = 0.0f;
this->m_cachedHeight = 0.0f;
}
void CSimpleFontString::SetIndentedWordWrap(bool a2) { void CSimpleFontString::SetIndentedWordWrap(bool a2) {
// TODO // TODO
} }
@ -837,6 +844,13 @@ void CSimpleFontString::SetNonWordWrap(int32_t a2) {
// TODO // TODO
} }
void CSimpleFontString::SetWidth(float width) {
this->CLayoutFrame::SetWidth(width);
this->m_cachedWidth = 0.0f;
this->m_cachedHeight = 0.0f;
}
void CSimpleFontString::UpdateString() { void CSimpleFontString::UpdateString() {
if (!(this->m_flags & 0x1)) { if (!(this->m_flags & 0x1)) {
return; return;

View File

@ -48,6 +48,8 @@ class CSimpleFontString : public CSimpleRegion, public CSimpleFontable {
virtual void OnColorChanged(bool a2); virtual void OnColorChanged(bool a2);
virtual void OnScreenSizeChanged(); virtual void OnScreenSizeChanged();
virtual void Draw(CRenderBatch* batch); virtual void Draw(CRenderBatch* batch);
virtual void SetWidth(float width);
virtual void SetHeight(float height);
virtual float GetWidth(); virtual float GetWidth();
virtual float GetHeight(); virtual float GetHeight();
virtual void OnFrameSizeChanged(const CRect& rect); virtual void OnFrameSizeChanged(const CRect& rect);