MantisBT - VCMI
View Issue Details
0001423VCMIGUI - Otherpublic2013-08-30 22:252022-04-11 17:49
Tow 
Ivan 
highmajoralways
closedfixed 
 
 
0001423: Some labels are not visible
Using the latest trunk (r3521) I observed that any labels are not rendered. Bug affects centered labels that doesn't have set proper width (eg. "Show available scenarios" button in pregame or building names in Town Hall screen).

In method void CTextContainer::blitLine (CIntObjectClasses.cpp l. 1240) this code:
    if (alignment == CENTER)
    {
        where.x += (destRect.w - f->getStringWidth(what)) / 2;
        where.y += (destRect.h - f->getLineHeight()) / 2;
    }

causes unsigned integer underflow: destRect sizes are zero.

I'd consider using signed integeres for return values of getStringWidth and getLineHeight. It is very easy to introduce such error with unsigned ints.
Run r3521, enter scenario selection screen. "Show available scenarios" button label is not visible.
No tags attached.
Issue History
2013-08-30 22:25TowNew Issue
2013-08-30 22:25TowStatusnew => assigned
2013-08-30 22:25TowAssigned To => Ivan
2013-08-31 00:23IvanNote Added: 0003916
2013-08-31 00:24IvanStatusassigned => resolved
2013-08-31 00:24IvanResolutionopen => fixed
2022-04-11 17:49PovelitelStatusresolved => closed

Notes
(0003916)
Ivan   
2013-08-31 00:23   
Should be fixed now. On my side it was OK likely due to 64-bit system.