operator ^ for last defined person
This commit is contained in:
+4
-4
@@ -81,11 +81,11 @@ void Person::displayInfo()const
|
||||
}
|
||||
|
||||
|
||||
static U16 strUtf8Symbols(const char* str)
|
||||
static U16 Utf8SymbolsCount(const string& str)
|
||||
{
|
||||
U16 num = 0;
|
||||
for(; *str != '\0'; ++str)
|
||||
num += ((*str & 0xC0) != 0x80);
|
||||
for(char c: str)
|
||||
num += ((c & 0xC0) != 0x80); // bytes that start with 0 are single, 11 are multiple, 10 are sucessors
|
||||
|
||||
return num;
|
||||
}
|
||||
@@ -113,7 +113,7 @@ U16 Person::draw(const I16 drawY, const I16 drawX, bool selected, bool hasSpouse
|
||||
}
|
||||
}
|
||||
|
||||
const U16 width = strUtf8Symbols(display_name.data()) + 4; /* pad width */
|
||||
const U16 width = Utf8SymbolsCount(display_name) + 4; /* pad width */
|
||||
|
||||
if(willBeVisible(drawY, drawX, BOX_HEIGHT, width))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user