mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1875054 [[Enhancement - Viewer] Zoom from current image size](https://bugs.launchpad.net/calibre/+bug/1875054)
This commit is contained in:
parent
cb5f6c7f31
commit
89b86799bf
@ -101,15 +101,24 @@ class ImageView(QDialog):
|
||||
if self.fit_image.isChecked():
|
||||
self.set_to_viewport_size()
|
||||
|
||||
def factor_from_fit(self):
|
||||
scaled_height = self.label.size().height()
|
||||
actual_height = self.current_img.size().height()
|
||||
return scaled_height / actual_height
|
||||
|
||||
def zoom_in(self):
|
||||
if self.fit_image.isChecked():
|
||||
factor = self.factor_from_fit()
|
||||
self.fit_image.setChecked(False)
|
||||
self.factor = factor
|
||||
self.factor *= 1.25
|
||||
self.adjust_image(1.25)
|
||||
|
||||
def zoom_out(self):
|
||||
if self.fit_image.isChecked():
|
||||
factor = self.factor_from_fit()
|
||||
self.fit_image.setChecked(False)
|
||||
self.factor = factor
|
||||
self.factor *= 0.8
|
||||
self.adjust_image(0.8)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user