summaryrefslogtreecommitdiff
path: root/modules/text_server_fb
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2021-01-19 10:50:43 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2021-01-31 20:10:50 +0200
commitc75923498e9a60466a0dde7a5fed3dd0108a790f (patch)
tree953d980edc138b39eec971d8cc0bb7ee5d3d9631 /modules/text_server_fb
parent5525cd85c60455b0bb9716bbef0ad2ad8111d752 (diff)
Use integer coordinates for the font glyphs rendering.
Diffstat (limited to 'modules/text_server_fb')
-rw-r--r--modules/text_server_fb/bitmap_font_fb.cpp2
-rw-r--r--modules/text_server_fb/dynamic_font_fb.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/text_server_fb/bitmap_font_fb.cpp b/modules/text_server_fb/bitmap_font_fb.cpp
index 5c691b7bbd..6bc838bd6a 100644
--- a/modules/text_server_fb/bitmap_font_fb.cpp
+++ b/modules/text_server_fb/bitmap_font_fb.cpp
@@ -321,7 +321,7 @@ Vector2 BitmapFontDataFallback::draw_glyph(RID p_canvas, int p_size, const Vecto
ERR_FAIL_COND_V(c == nullptr, Vector2());
ERR_FAIL_COND_V(c->texture_idx < -1 || c->texture_idx >= textures.size(), Vector2());
if (c->texture_idx != -1) {
- Point2 cpos = p_pos;
+ Point2i cpos = p_pos;
cpos += c->align * (float(p_size) / float(base_size));
cpos.y -= ascent * (float(p_size) / float(base_size));
diff --git a/modules/text_server_fb/dynamic_font_fb.cpp b/modules/text_server_fb/dynamic_font_fb.cpp
index 4eecba6ae8..df7756cbd0 100644
--- a/modules/text_server_fb/dynamic_font_fb.cpp
+++ b/modules/text_server_fb/dynamic_font_fb.cpp
@@ -626,7 +626,7 @@ Vector2 DynamicFontDataFallback::draw_glyph(RID p_canvas, int p_size, const Vect
ERR_FAIL_COND_V(ch.texture_idx < -1 || ch.texture_idx >= fds->textures.size(), Vector2());
if (ch.texture_idx != -1) {
- Point2 cpos = p_pos;
+ Point2i cpos = p_pos;
cpos += ch.align;
Color modulate = p_color;
@@ -658,7 +658,7 @@ Vector2 DynamicFontDataFallback::draw_glyph_outline(RID p_canvas, int p_size, in
ERR_FAIL_COND_V(ch.texture_idx < -1 || ch.texture_idx >= fds->textures.size(), Vector2());
if (ch.texture_idx != -1) {
- Point2 cpos = p_pos;
+ Point2i cpos = p_pos;
cpos += ch.align;
Color modulate = p_color;