mirror of
https://github.com/koreader/koreader
synced 2024-11-11 19:11:14 +00:00
Merge pull request #745 from houqp/new_ui_code
fix bug in getPitch, returning half of ptich for 4bpp fb
This commit is contained in:
commit
c235e892c1
6
einkfb.c
6
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user