diff options
author | chai <chaifix@163.com> | 2018-10-14 22:52:40 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-14 22:52:40 +0800 |
commit | b1bbc998960fff2169dc5a992c47d08723472f9b (patch) | |
tree | 220f3bd5de2266e248884e11161dd715d7632ef2 /src/lua/modules/graphics/page.cpp | |
parent | fbf989f9950a38566e0fb0fc5b6a7aebc9f0fb45 (diff) |
*直接渲染字符串
Diffstat (limited to 'src/lua/modules/graphics/page.cpp')
-rw-r--r-- | src/lua/modules/graphics/page.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/lua/modules/graphics/page.cpp b/src/lua/modules/graphics/page.cpp index fd96448..c0a3184 100644 --- a/src/lua/modules/graphics/page.cpp +++ b/src/lua/modules/graphics/page.cpp @@ -3,6 +3,8 @@ #include "lua/common/common.h" #include "libjin/jin.h" +#include <iostream> + namespace jin { namespace lua @@ -21,29 +23,35 @@ namespace lua static int l_gc(lua_State* L) { Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_PAGE); - proxy->release(); + { + /* release font */ + Ref<Page>* page = &proxy->getRef<Page>(); + RefBase* font = (RefBase*)page->getUserdata(); + font->release(); + } + proxy->release(); return 0; } static int l_getSize(lua_State* L) { Page* page = getPage(L); - luax_pushinteger(L, page->width); - luax_pushinteger(L, page->height); + luax_pushinteger(L, page->size.w); + luax_pushinteger(L, page->size.h); return 2; } static int l_getWidth(lua_State* L) { Page* page = getPage(L); - luax_pushinteger(L, page->width); + luax_pushinteger(L, page->size.w); return 1; } static int l_getHeight(lua_State* L) { Page* page = getPage(L); - luax_pushinteger(L, page->height); + luax_pushinteger(L, page->size.h); return 1; } |