mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Lift window width constraint of .getPreferredTextSize
The method's point is to calculate a text's height and width if it was written in a single line -- no matter how long the caption, even if it's wider than the window.
This commit is contained in:
parent
835f59a604
commit
83f4d8789b
1 changed files with 2 additions and 1 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#include "maths/Rect.h"
|
||||
#include "maths/Size2D.h"
|
||||
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
|
@ -120,7 +121,7 @@ CSize2D CText::GetTextSize()
|
|||
|
||||
CSize2D CText::GetPreferredTextSize()
|
||||
{
|
||||
return CGUIText{m_pGUI, m_Caption, m_Font, m_pGUI.GetWindowSize().Width, m_BufferZone, m_TextAlign, this}.GetSize();
|
||||
return CGUIText{m_pGUI, m_Caption, m_Font, std::numeric_limits<float>::max(), m_BufferZone, m_TextAlign, this}.GetSize();
|
||||
}
|
||||
|
||||
const CStrW& CText::GetTooltipText() const
|
||||
|
|
|
|||
Loading…
Reference in a new issue