Fix manual zoom padding, Speed up hashing

This commit is contained in:
BasioMeusPuga
2017-11-19 17:36:42 +05:30
parent bc8a533bb8
commit 6ca94924cf
4 changed files with 23 additions and 7 deletions

View File

@@ -512,6 +512,12 @@ class PliantQGraphicsView(QtWidgets.QGraphicsView):
elif zoom_mode == 'originalSize':
image_pixmap = self.image_pixmap
new_padding = (self.viewport().width() - image_pixmap.width()) // 2
if new_padding < 0: # The image is larger than the viewport
self.main_window.comic_profile['padding'] = 0
else:
self.main_window.comic_profile['padding'] = new_padding
elif zoom_mode == 'bestFit':
available_width = self.viewport().width()
available_height = self.viewport().height()
@@ -520,6 +526,9 @@ class PliantQGraphicsView(QtWidgets.QGraphicsView):
available_width, available_height,
QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
self.main_window.comic_profile['padding'] = (
self.viewport().width() - image_pixmap.width()) // 2
elif zoom_mode == 'manualZoom':
available_width = self.viewport().width() - 2 * padding
image_pixmap = self.image_pixmap.scaledToWidth(