Updated plugins

This commit is contained in:
Moritz Lipp 2011-04-18 18:05:17 +02:00
parent 2eed47a314
commit 08117975d3
3 changed files with 13 additions and 13 deletions

View file

@ -218,13 +218,13 @@ djvu_page_form_fields_get(zathura_page_t* page)
zathura_image_buffer_t* zathura_image_buffer_t*
djvu_page_render(zathura_page_t* page) djvu_page_render(zathura_page_t* page)
{ {
if (!Zathura.document || !page || !page->document) { if (!page || !page->document) {
return NULL; return NULL;
} }
/* calculate sizes */ /* calculate sizes */
unsigned int page_width = Zathura.document->scale * page->width; unsigned int page_width = page->document->scale * page->width;
unsigned int page_height = Zathura.document->scale * page->height; unsigned int page_height = page->document->scale * page->height;
if (!page_width || !page_height) { if (!page_width || !page_height) {
goto error_out; goto error_out;

View file

@ -176,15 +176,15 @@ pdf_page_form_fields_get(zathura_page_t* page)
zathura_image_buffer_t* zathura_image_buffer_t*
pdf_page_render(zathura_page_t* page) pdf_page_render(zathura_page_t* page)
{ {
if (!Zathura.document || !page || !page->data || !page->document) { if (!page || !page->data || !page->document) {
return NULL; return NULL;
} }
/* calculate sizes */ /* calculate sizes */
unsigned int page_width = Zathura.document->scale * page->width; unsigned int page_width = page->document->scale * page->width;
unsigned int page_height = Zathura.document->scale * page->height; unsigned int page_height = page->document->scale * page->height;
if (Zathura.document->rotate == 90 || Zathura.document->rotate == 270) { if (page->document->rotate == 90 || page->document->rotate == 270) {
unsigned int dim_temp = 0; unsigned int dim_temp = 0;
dim_temp = page_width; dim_temp = page_width;
page_width = page_height; page_width = page_height;
@ -215,9 +215,9 @@ pdf_page_render(zathura_page_t* page)
fz_matrix ctm = fz_identity; fz_matrix ctm = fz_identity;
ctm = fz_concat(ctm, fz_translate(0, -mupdf_page->page->mediabox.y1)); ctm = fz_concat(ctm, fz_translate(0, -mupdf_page->page->mediabox.y1));
ctm = fz_concat(ctm, fz_scale(Zathura.document->scale, -Zathura.document->scale)); ctm = fz_concat(ctm, fz_scale(page->document->scale, -page->document->scale));
ctm = fz_concat(ctm, fz_rotate(mupdf_page->page->rotate)); ctm = fz_concat(ctm, fz_rotate(mupdf_page->page->rotate));
ctm = fz_concat(ctm, fz_rotate(Zathura.document->rotate)); ctm = fz_concat(ctm, fz_rotate(page->document->rotate));
fz_bbox bbox = fz_roundrect(fz_transformrect(ctm, mupdf_page->page->mediabox)); fz_bbox bbox = fz_roundrect(fz_transformrect(ctm, mupdf_page->page->mediabox));
fz_pixmap* pixmap = fz_newpixmapwithrect(fz_devicergb, bbox); fz_pixmap* pixmap = fz_newpixmapwithrect(fz_devicergb, bbox);

View file

@ -253,13 +253,13 @@ pdf_page_form_fields_get(zathura_page_t* page)
zathura_image_buffer_t* zathura_image_buffer_t*
pdf_page_render(zathura_page_t* page) pdf_page_render(zathura_page_t* page)
{ {
if (!Zathura.document || !page || !page->data || !page->document) { if (!page || !page->data || !page->document) {
return NULL; return NULL;
} }
/* calculate sizes */ /* calculate sizes */
unsigned int page_width = Zathura.document->scale * page->width; unsigned int page_width = page->document->scale * page->width;
unsigned int page_height = Zathura.document->scale * page->height; unsigned int page_height = page->document->scale * page->height;
/* create pixbuf */ /* create pixbuf */
GdkPixbuf* pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, GdkPixbuf* pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8,
@ -270,7 +270,7 @@ pdf_page_render(zathura_page_t* page)
} }
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,
Zathura.document->scale, 90, pixbuf); page->document->scale, 90, pixbuf);
/* create image buffer */ /* create image buffer */
zathura_image_buffer_t* image_buffer = zathura_image_buffer_create(page_width, page_height); zathura_image_buffer_t* image_buffer = zathura_image_buffer_create(page_width, page_height);