summaryrefslogtreecommitdiff
path: root/editor/import/resource_importer_imagefont.cpp
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2023-04-16 18:42:45 +0300
committerYuri Sizov <yuris@humnom.net>2023-04-26 14:14:06 +0200
commit357e2ec05def4202e6e1c8c1ab91f0a02fc035f1 (patch)
treedcbe19268208190c7d81a52aa15960e5a98cec31 /editor/import/resource_importer_imagefont.cpp
parent769daf79e2d77232ffb95cc41c007046dc674a30 (diff)
[Image Font] Fix fractional ascent for font with odd height.
(cherry picked from commit 41f7bb2025d3cdaf89ae4e22a906484a620d4ab2)
Diffstat (limited to 'editor/import/resource_importer_imagefont.cpp')
-rw-r--r--editor/import/resource_importer_imagefont.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/import/resource_importer_imagefont.cpp b/editor/import/resource_importer_imagefont.cpp
index e6ba84294a..cbd00f0f6b 100644
--- a/editor/import/resource_importer_imagefont.cpp
+++ b/editor/import/resource_importer_imagefont.cpp
@@ -151,7 +151,7 @@ Error ResourceImporterImageFont::import(const String &p_source_file, const Strin
int x = pos % columns;
int y = pos / columns;
font->set_glyph_advance(0, chr_height, idx, Vector2(chr_width, 0));
- font->set_glyph_offset(0, Vector2i(chr_height, 0), idx, Vector2(0, -0.5 * chr_height));
+ font->set_glyph_offset(0, Vector2i(chr_height, 0), idx, Vector2i(0, -0.5 * chr_height));
font->set_glyph_size(0, Vector2i(chr_height, 0), idx, Vector2(chr_width, chr_height));
font->set_glyph_uv_rect(0, Vector2i(chr_height, 0), idx, Rect2(img_margin.position.x + chr_cell_width * x + char_margin.position.x, img_margin.position.y + chr_cell_height * y + char_margin.position.y, chr_width, chr_height));
font->set_glyph_texture_idx(0, Vector2i(chr_height, 0), idx, 0);