Clean up font setting

This commit is contained in:
Rob Loach
2022-05-16 04:05:18 -04:00
parent 6198aee6bf
commit fd436de602
2 changed files with 3 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
msg.SetFontSize(msg.GetFontSize() + GetMouseWheelMove() * 4.0f);
msg.fontSize += GetMouseWheelMove() * 4.0f;
// Choose font texture filter method
if (IsKeyPressed(KEY_ONE))
@@ -76,8 +76,7 @@ int main(void)
// Load a dropped TTF file dynamically (at current fontSize)
for (const auto& file : raylib::GetDroppedFiles()) {
if (raylib::IsFileExtension(file, ".ttf")) {
font = raylib::Font(file, font.GetBaseSize());
msg.SetFont(font);
msg.font = font = raylib::Font(file, font.GetBaseSize());
}
}
//----------------------------------------------------------------------------------

View File

@@ -64,7 +64,7 @@ class Text {
*
* @see DrawTextPro()
*/
inline void Draw(const ::Vector2& position, const Vector2& origin, float rotation = 0) {
inline void Draw(const ::Vector2& position, float rotation, const Vector2& origin = {0, 0}) {
::DrawTextPro(font, text.c_str(), position, origin, rotation, fontSize, spacing, color);
}