Skip to content

Commit fd436de

Browse files
committed
Clean up font setting
1 parent 6198aee commit fd436de

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

examples/text/text_font_filters.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int main(void)
4848
{
4949
// Update
5050
//----------------------------------------------------------------------------------
51-
msg.SetFontSize(msg.GetFontSize() + GetMouseWheelMove() * 4.0f);
51+
msg.fontSize += GetMouseWheelMove() * 4.0f;
5252

5353
// Choose font texture filter method
5454
if (IsKeyPressed(KEY_ONE))
@@ -76,8 +76,7 @@ int main(void)
7676
// Load a dropped TTF file dynamically (at current fontSize)
7777
for (const auto& file : raylib::GetDroppedFiles()) {
7878
if (raylib::IsFileExtension(file, ".ttf")) {
79-
font = raylib::Font(file, font.GetBaseSize());
80-
msg.SetFont(font);
79+
msg.font = font = raylib::Font(file, font.GetBaseSize());
8180
}
8281
}
8382
//----------------------------------------------------------------------------------

include/Text.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Text {
6464
*
6565
* @see DrawTextPro()
6666
*/
67-
inline void Draw(const ::Vector2& position, const Vector2& origin, float rotation = 0) {
67+
inline void Draw(const ::Vector2& position, float rotation, const Vector2& origin = {0, 0}) {
6868
::DrawTextPro(font, text.c_str(), position, origin, rotation, fontSize, spacing, color);
6969
}
7070

0 commit comments

Comments
 (0)