Add big fonticon modifier to multiply size by 1.5
This commit is contained in:
parent
6e0586a335
commit
59e1099c06
@ -318,6 +318,10 @@ namespace Components
|
|||||||
fontIcon.flipVertical = true;
|
fontIcon.flipVertical = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'b':
|
||||||
|
fontIcon.big = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case ':':
|
case ':':
|
||||||
breakArgs = true;
|
breakArgs = true;
|
||||||
break;
|
break;
|
||||||
@ -350,7 +354,8 @@ namespace Components
|
|||||||
const auto* colorMap = GetFontIconColorMap(fontIcon.material);
|
const auto* colorMap = GetFontIconColorMap(fontIcon.material);
|
||||||
if (colorMap == nullptr)
|
if (colorMap == nullptr)
|
||||||
return 0;
|
return 0;
|
||||||
return static_cast<float>(font->pixelHeight) * (static_cast<float>(colorMap->width) / static_cast<float>(colorMap->height)) * xScale;
|
const auto sizeMultiplier = fontIcon.big ? 1.5f : 1.0f;
|
||||||
|
return static_cast<float>(font->pixelHeight) * (static_cast<float>(colorMap->width) / static_cast<float>(colorMap->height)) * xScale * sizeMultiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
float TextRenderer::DrawFontIcon(const FontIconInfo& fontIcon, const float x, const float y, const float sinAngle, const float cosAngle, const Game::Font_s* font, const float xScale, const float yScale, const unsigned color)
|
float TextRenderer::DrawFontIcon(const FontIconInfo& fontIcon, const float x, const float y, const float sinAngle, const float cosAngle, const Game::Font_s* font, const float xScale, const float yScale, const unsigned color)
|
||||||
@ -380,9 +385,10 @@ namespace Components
|
|||||||
t0 = 0.0f;
|
t0 = 0.0f;
|
||||||
t1 = 1.0f;
|
t1 = 1.0f;
|
||||||
}
|
}
|
||||||
|
const auto sizeMultiplier = fontIcon.big ? 1.5f : 1.0f;
|
||||||
|
|
||||||
const auto h = static_cast<float>(font->pixelHeight) * yScale;
|
const auto h = static_cast<float>(font->pixelHeight) * yScale * sizeMultiplier;
|
||||||
const auto w = static_cast<float>(font->pixelHeight) * (static_cast<float>(colorMap->width) / static_cast<float>(colorMap->height)) * xScale;
|
const auto w = static_cast<float>(font->pixelHeight) * (static_cast<float>(colorMap->width) / static_cast<float>(colorMap->height)) * xScale * sizeMultiplier;
|
||||||
|
|
||||||
const auto yy = y - (h + yScale * static_cast<float>(font->pixelHeight)) * 0.5f;
|
const auto yy = y - (h + yScale * static_cast<float>(font->pixelHeight)) * 0.5f;
|
||||||
Game::RB_DrawStretchPicRotate(fontIcon.material, x, yy, w, h, s0, t0, s1, t1, sinAngle, cosAngle, color);
|
Game::RB_DrawStretchPicRotate(fontIcon.material, x, yy, w, h, s0, t0, s1, t1, sinAngle, cosAngle, color);
|
||||||
|
@ -47,6 +47,7 @@ namespace Components
|
|||||||
Game::Material* material;
|
Game::Material* material;
|
||||||
bool flipHorizontal;
|
bool flipHorizontal;
|
||||||
bool flipVertical;
|
bool flipVertical;
|
||||||
|
bool big;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HsvColor
|
struct HsvColor
|
||||||
|
Loading…
Reference in New Issue
Block a user