minor changes - code style, default zoom

This commit is contained in:
LunarEclipse 2024-05-24 19:15:42 +02:00
parent e124669185
commit 25c89fd5d5
1 changed files with 6 additions and 6 deletions

View File

@ -43,7 +43,7 @@ class PdfPage(Gtk.DrawingArea):
super().__init__(*args, **kwargs)
self.page: Page = page
pix: fitz.Pixmap = self.page.raw.get_pixmap(dpi=96) # type: ignore
pix: fitz.Pixmap = self.page.raw.get_pixmap(dpi=50) # type: ignore
self.set_size_request(pix.width, pix.height)
self.connect("draw", self.on_draw, {})
@ -60,7 +60,7 @@ class PdfPage(Gtk.DrawingArea):
sctx = widget.get_style_context()
Gtk.render_background(sctx, cr, 0, 0, width, height)
pix: fitz.Pixmap = self.page.raw.get_pixmap(dpi=96) # type: ignore
pix: fitz.Pixmap = self.page.raw.get_pixmap(dpi=50) # type: ignore
img = PIL.Image.frombytes("RGBA" if pix.alpha else "RGB", [pix.width, pix.height], pix.samples)
img.putalpha(1)
img = PIL.Image.merge("RGBA", (lambda r, g, b, a: (b, g, r, a))(*img.split())) # type: ignore