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:
1 parent
835f59a604
commit
83f4d8789b
1 file changed
+2
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user