diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-12-17 13:22:04 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2020-12-21 07:49:27 +0200 |
commit | 1adea98d070783c8b5a560eeb1f9ca636db28514 (patch) | |
tree | 2ae4495d3cb1940032b296b06f0a5e480298e559 /modules/text_server_adv | |
parent | 7d5a8ea0e9c22b5e9b513de6ceb49f34fe120cc3 (diff) |
Use integer text position in scroll container, TextEdit and canvas editor, to ensure sharp text rendering.
Use integer font align/advance with any font scaling, to ensure sharp text rendering.
Diffstat (limited to 'modules/text_server_adv')
-rw-r--r-- | modules/text_server_adv/dynamic_font_adv.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/text_server_adv/dynamic_font_adv.cpp b/modules/text_server_adv/dynamic_font_adv.cpp index 08c4ad2727..99d78a5299 100644 --- a/modules/text_server_adv/dynamic_font_adv.cpp +++ b/modules/text_server_adv/dynamic_font_adv.cpp @@ -432,8 +432,8 @@ DynamicFontDataAdvanced::Character DynamicFontDataAdvanced::bitmap_to_character( } Character chr; - chr.align = Vector2(xofs, -yofs) * p_data->scale_color_font / oversampling; - chr.advance = advance * p_data->scale_color_font / oversampling; + chr.align = (Vector2(xofs, -yofs) * p_data->scale_color_font / oversampling).round(); + chr.advance = (advance * p_data->scale_color_font / oversampling).round(); chr.texture_idx = tex_pos.index; chr.found = true; |