Skip to content

Commit

Permalink
improve pdf-viewer render quality
Browse files Browse the repository at this point in the history
  • Loading branch information
zbelial committed Oct 19, 2020
1 parent 296780a commit 335a135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/pdf-viewer/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def paintEvent(self, event):
# Draw page image.
if self.read_mode == "fit_to_customize" and render_width >= self.rect().width():
render_x = max(min(render_x + self.horizontal_offset, 0), self.rect().width() - render_width) # limit the visiable area size
painter.drawPixmap(QRect(render_x, render_y, render_width, render_height), qpixmap)
painter.drawPixmap(QRect(render_x, render_y, qpixmap.width(), qpixmap.height()), qpixmap)

# Clean unused pixmap cache that avoid use too much memory.
self.clean_unused_page_cache_pixmap()
Expand Down

0 comments on commit 335a135

Please sign in to comment.