aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/graphics/page.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/modules/graphics/page.cpp')
-rw-r--r--src/lua/modules/graphics/page.cpp18
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;
}