feat(ui): add CLayoutFrame::GetSize

This commit is contained in:
fallenoak 2026-02-05 07:01:30 -06:00
parent 856bb72e1a
commit 534e05be93
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 19 additions and 2 deletions

View File

@ -332,6 +332,10 @@ void CLayoutFrame::GetFirstPointY(const FRAMEPOINT* const pointarray, int32_t el
}
}
float CLayoutFrame::GetHeight() {
return this->m_height;
}
CLayoutFrame* CLayoutFrame::GetLayoutFrameByName(const char* name) {
return nullptr;
}
@ -353,8 +357,20 @@ int32_t CLayoutFrame::GetRect(CRect* rect) {
return 1;
}
float CLayoutFrame::GetHeight() {
return this->m_height;
void CLayoutFrame::GetSize(float& width, float& height, int32_t a4) {
width = this->GetWidth();
height = this->GetHeight();
if (!a4 && (width == 0.0f || height == 0.0f)) {
if (this->m_flags & FLAG_RESIZE_PENDING) {
this->Resize(1);
}
if (this->m_flags & 0x1) {
width = (this->m_rect.maxX - this->m_rect.minX) / this->m_layoutScale;
height = (this->m_rect.maxY - this->m_rect.minY) / this->m_layoutScale;
}
}
}
float CLayoutFrame::GetWidth() {

View File

@ -51,6 +51,7 @@ class CLayoutFrame {
virtual void SetHeight(float height);
virtual float GetWidth();
virtual float GetHeight();
virtual void GetSize(float& width, float& height, int32_t a4);
virtual void GetClampRectInsets(float& a1, float& a2, float& a3, float& a4);
virtual int32_t IsAttachmentOrigin();
virtual CLayoutFrame* GetLayoutFrameByName(const char* name);