From 6dc75930fe5fe02f1af5489917752d315cf9e48f Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 22 Oct 2018 21:46:24 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9graphic=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Graphics/Font/je_texture_font.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libjin/Graphics/Font/je_texture_font.cpp') 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); -- cgit v1.1-26-g67d0