Fixed scale

This commit is contained in:
Moritz Lipp 2009-12-28 20:02:07 +01:00
parent b7ef4a3ab8
commit 852868a462

View file

@ -343,6 +343,7 @@ void draw(int page_id)
double page_width, page_height; double page_width, page_height;
double width, height; double width, height;
double scale = ((double) Zathura.PDF.scale / 100.0);
Page *current_page = Zathura.PDF.pages[page_id]; Page *current_page = Zathura.PDF.pages[page_id];
@ -354,13 +355,13 @@ void draw(int page_id)
if(Zathura.PDF.rotate == 0 || Zathura.PDF.rotate == 180) if(Zathura.PDF.rotate == 0 || Zathura.PDF.rotate == 180)
{ {
width = page_width * Zathura.PDF.scale; width = page_width * scale;
height = page_height * Zathura.PDF.scale; height = page_height * scale;
} }
else else
{ {
width = page_height * Zathura.PDF.scale; width = page_height * scale;
height = page_width * Zathura.PDF.scale; height = page_width * scale;
} }
cairo_t *cairo; cairo_t *cairo;
@ -389,8 +390,8 @@ void draw(int page_id)
cairo_translate(cairo, 0, 0); cairo_translate(cairo, 0, 0);
} }
if(Zathura.PDF.scale != 1.0) if(scale != 1.0)
cairo_scale(cairo, Zathura.PDF.scale, Zathura.PDF.scale); cairo_scale(cairo, scale, scale);
if(Zathura.PDF.rotate != 0) if(Zathura.PDF.rotate != 0)
cairo_rotate(cairo, Zathura.PDF.rotate * G_PI / 180.0); cairo_rotate(cairo, Zathura.PDF.rotate * G_PI / 180.0);