From c43053605ff5b90f66437a5f11a27ad44c767eb1 Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Mon, 18 Feb 2013 00:15:30 +0800 Subject: [PATCH] fix bug in getPitch, returning half of ptich for 4bpp fb --- einkfb.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/einkfb.c b/einkfb.c index efb61cd0c..b5a3bf50b 100644 --- a/einkfb.c +++ b/einkfb.c @@ -281,11 +281,9 @@ static int getSize(lua_State *L) { static int getPitch(lua_State *L) { FBInfo *fb = (FBInfo*) luaL_checkudata(L, 1, "einkfb"); -#ifndef EMULATE_READER - lua_pushinteger(L, fb->finfo.line_length/2); -#else + /* for 8bpp devices, the pitch here is line_length/2, not + * the original pitch, i.e. fb->real_buf->pitch */ lua_pushinteger(L, fb->buf->pitch); -#endif return 1; }