mirror of https://github.com/OpenTTD/OpenTTD
(svn r25766) -Codechange: Use FONT_HEIGHT_NORMAL instead of checking the height of a dummy string in Story gui
parent
0746816b16
commit
9e30dda720
|
@ -326,7 +326,7 @@ protected:
|
||||||
case SPET_GOAL:
|
case SPET_GOAL:
|
||||||
case SPET_LOCATION: {
|
case SPET_LOCATION: {
|
||||||
Dimension sprite_dim = GetSpriteSize(GetPageElementSprite(pe));
|
Dimension sprite_dim = GetSpriteSize(GetPageElementSprite(pe));
|
||||||
int line_height = GetStringHeight(STR_JUST_NOTHING, INT_MAX);
|
int line_height = FONT_HEIGHT_NORMAL;
|
||||||
if (line_height == 0) return 1;
|
if (line_height == 0) return 1;
|
||||||
return max((uint)1, sprite_dim.height / (uint)line_height);
|
return max((uint)1, sprite_dim.height / (uint)line_height);
|
||||||
break;
|
break;
|
||||||
|
@ -498,7 +498,7 @@ public:
|
||||||
_cur_dpi = &tmp_dpi;
|
_cur_dpi = &tmp_dpi;
|
||||||
|
|
||||||
/* Draw content (now coordinates given to Draw** are local to the new clipping region). */
|
/* Draw content (now coordinates given to Draw** are local to the new clipping region). */
|
||||||
int line_height = GetStringHeight(STR_JUST_NOTHING, INT_MAX);
|
int line_height = FONT_HEIGHT_NORMAL;
|
||||||
int y_offset = - this->vscroll->GetPosition() * line_height;
|
int y_offset = - this->vscroll->GetPosition() * line_height;
|
||||||
|
|
||||||
/* Date */
|
/* Date */
|
||||||
|
@ -549,7 +549,8 @@ public:
|
||||||
{
|
{
|
||||||
if (widget != WID_SB_SEL_PAGE && widget != WID_SB_PAGE_PANEL) return;
|
if (widget != WID_SB_SEL_PAGE && widget != WID_SB_PAGE_PANEL) return;
|
||||||
|
|
||||||
Dimension d = GetStringBoundingBox(STR_JUST_NOTHING);
|
Dimension d;
|
||||||
|
d.height= FONT_HEIGHT_NORMAL;
|
||||||
d.width = 0;
|
d.width = 0;
|
||||||
|
|
||||||
switch(widget) {
|
switch(widget) {
|
||||||
|
|
Loading…
Reference in New Issue