aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/Font/je_texture_font.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Graphics/Font/je_texture_font.cpp')
-rw-r--r--src/libjin/Graphics/Font/je_texture_font.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libjin/Graphics/Font/je_texture_font.cpp b/src/libjin/Graphics/Font/je_texture_font.cpp
index 2c04815..9651c1a 100644
--- a/src/libjin/Graphics/Font/je_texture_font.cpp
+++ b/src/libjin/Graphics/Font/je_texture_font.cpp
@@ -101,8 +101,9 @@ namespace JinEngine
}
glyphinfolist[glyphinfolist.size() - 1].count += 4;
// normalized
- float nx = glyph->x / (float)mSize.w, ny = glyph->y / (float)mSize.h;
- float nw = glyph->w / (float)mSize.w, nh = glyph->h / (float)mSize.h;
+ float w = getWidth(), h = getHeight();
+ float nx = glyph->x / w, ny = glyph->y / h;
+ float nw = glyph->w / w, nh = glyph->h / h;
glyphvertices_push(p.x, p.y, nx, ny);
glyphvertices_push(p.x, p.y + glyph->h, nx, ny + nh);
glyphvertices_push(p.x + glyph->w, p.y + glyph->h, nx + nw, ny + nh);