mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-08 06:08:29 +02:00
CtextBox: Precise function getLines()
Use refreshTextLineArray() for calculation of lines.
Note: count of lines will be only returned if CTextBox object
is initialized with a valid CBox instance,
otherwise count of 0 lines will be returned!
also remove inline declaration, not needed here
Origin commit data
------------------
Commit: ec83549e50
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-06-15 (Thu, 15 Jun 2017)
This commit is contained in:
@@ -900,6 +900,16 @@ int CTextBox::getLines(const std::string& text)
|
||||
return count;
|
||||
}
|
||||
|
||||
int CTextBox::getLines()
|
||||
{
|
||||
if (m_cText.empty())
|
||||
return 0;
|
||||
|
||||
refreshTextLineArray();
|
||||
|
||||
return m_nNrOfLines;
|
||||
}
|
||||
|
||||
int CTextBox::getMaxLineWidth(const std::string& text, Font* font)
|
||||
{
|
||||
std::string txt = text;
|
||||
|
Reference in New Issue
Block a user