mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
fixed blitting bug
This commit is contained in:
7
pdf.c
7
pdf.c
@@ -237,6 +237,7 @@ static int closePage(lua_State *L) {
|
||||
pdf_age_store(page->doc->xref->store, 2);
|
||||
page->page = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int drawPage(lua_State *L) {
|
||||
@@ -291,11 +292,11 @@ static int drawPage(lua_State *L) {
|
||||
int x, y;
|
||||
|
||||
for(y = 0; y < bb->h; y++) {
|
||||
for(x = 0; x < bb->w; x+=2) {
|
||||
bbptr[x / 2] = (((pmptr[x+1] & 0xF0) >> 4) | (pmptr[x] & 0xF0)) ^ 0xFF;
|
||||
for(x = 0; x < (bb->w / 2); x++) {
|
||||
bbptr[x] = (((pmptr[x*2 + 1] & 0xF0) >> 4) | (pmptr[x*2] & 0xF0)) ^ 0xFF;
|
||||
}
|
||||
if(bb->w & 1) {
|
||||
bbptr[x / 2] = pmptr[x-1] & 0xF0;
|
||||
bbptr[x] = pmptr[x*2] & 0xF0;
|
||||
}
|
||||
bbptr += bb->pitch;
|
||||
pmptr += bb->w;
|
||||
|
||||
Reference in New Issue
Block a user