Use integer coordinates for the font glyphs rendering.

This commit is contained in:
bruvzg 2021-01-19 10:50:43 +02:00
parent 5525cd85c6
commit c75923498e
No known key found for this signature in database
GPG key ID: 009E1BFE42239B95
6 changed files with 8 additions and 10 deletions

View file

@ -540,7 +540,7 @@ Vector2 BitmapFontDataAdvanced::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));
if (RenderingServer::get_singleton() != nullptr) {