mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 11:06:00 +01:00
Fixed rendering for mupdf/poppler backend
This commit is contained in:
parent
a77ca6fef5
commit
07cc456ae9
3 changed files with 5 additions and 5 deletions
|
@ -230,7 +230,7 @@ pdf_page_render(zathura_page_t* page)
|
|||
for (unsigned int y = 0; y < pixmap->h; y++) {
|
||||
for (unsigned int x = 0; x < pixmap->w; x++) {
|
||||
unsigned char *s = pixmap->samples + y * pixmap->w * 4 + x * 4;
|
||||
guchar* p = image_buffer->data + y * image_buffer->width + x;
|
||||
guchar* p = image_buffer->data + y * image_buffer->rowstride + x * 3;
|
||||
p[0] = s[0];
|
||||
p[1] = s[1];
|
||||
p[2] = s[2];
|
||||
|
|
|
@ -269,7 +269,7 @@ pdf_page_render(zathura_page_t* page)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
poppler_page_render_to_pixbuf(page->data, 0, 0, page_width, page_height,
|
||||
poppler_page_render_to_pixbuf(page->data, 0, 0, page->width, page->height,
|
||||
page->document->scale, 0, pixbuf);
|
||||
|
||||
/* create image buffer */
|
||||
|
@ -288,7 +288,7 @@ pdf_page_render(zathura_page_t* page)
|
|||
for (unsigned int y = 0; y < page_height; y++) {
|
||||
for (unsigned int x = 0; x < page_width; x++) {
|
||||
unsigned char *s = pixels + y * rowstride + x * n_channels;
|
||||
guchar* p = image_buffer->data + y * image_buffer->width + x;
|
||||
guchar* p = image_buffer->data + y * image_buffer->rowstride + x * 3;
|
||||
p[0] = s[0];
|
||||
p[1] = s[1];
|
||||
p[2] = s[2];
|
||||
|
|
4
render.c
4
render.c
|
@ -162,9 +162,9 @@ render(zathura_t* zathura, zathura_page_t* page)
|
|||
unsigned char* src = image_buffer->data + y * image_buffer->rowstride;
|
||||
|
||||
for (unsigned int x = 0; x < page_width; x++) {
|
||||
dst[0] = src[0];
|
||||
dst[0] = src[2];
|
||||
dst[1] = src[1];
|
||||
dst[2] = src[2];
|
||||
dst[2] = src[0];
|
||||
src += 3;
|
||||
dst += 4;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue