diff options
author | chai <chaifix@163.com> | 2018-10-22 21:46:24 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-22 21:46:24 +0800 |
commit | 6dc75930fe5fe02f1af5489917752d315cf9e48f (patch) | |
tree | c634d6997d58af783e3866755fc38a96f97806ac /src/libjin/Graphics/Font/je_texture_font.cpp | |
parent | 8c0da1990d6e7f9ad19c5270c0fdee848af829a1 (diff) |
*修改graphic接口
Diffstat (limited to 'src/libjin/Graphics/Font/je_texture_font.cpp')
-rw-r--r-- | src/libjin/Graphics/Font/je_texture_font.cpp | 5 |
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); |