summaryrefslogtreecommitdiff
path: root/modules/text_server_fb
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2020-12-17 13:22:04 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2020-12-21 07:49:27 +0200
commit1adea98d070783c8b5a560eeb1f9ca636db28514 (patch)
tree2ae4495d3cb1940032b296b06f0a5e480298e559 /modules/text_server_fb
parent7d5a8ea0e9c22b5e9b513de6ceb49f34fe120cc3 (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_fb')
-rw-r--r--modules/text_server_fb/dynamic_font_fb.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/text_server_fb/dynamic_font_fb.cpp b/modules/text_server_fb/dynamic_font_fb.cpp
index 6731870e8f..ca9e5b580b 100644
--- a/modules/text_server_fb/dynamic_font_fb.cpp
+++ b/modules/text_server_fb/dynamic_font_fb.cpp
@@ -317,8 +317,8 @@ DynamicFontDataFallback::Character DynamicFontDataFallback::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;