mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-05 15:42:17 +03:00
feat(ui): add CLayoutFrame::GetSize
This commit is contained in:
parent
856bb72e1a
commit
534e05be93
@ -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() {
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user