only scale if the image is too large
This commit is contained in:
@@ -26,9 +26,13 @@ class ImagePopup(QtWidgets.QLabel):
|
||||
self.popup_timer = QtCore.QTimer()
|
||||
self.popup_timer.timeout.connect(self.check_mouse)
|
||||
|
||||
pixmap = QtGui.QPixmap(filename).scaled(
|
||||
settings.value("ImagePopup/w", type=int),
|
||||
settings.value("ImagePopup/h", type=int),
|
||||
pixmap = QtGui.QPixmap(filename)
|
||||
W = settings.value("ImagePopup/w", type=int)
|
||||
H = settings.value("ImagePopup/h", type=int)
|
||||
if pixmap.height() > H or pixmap.width() > W:
|
||||
pixmap = pixmap.scaled(
|
||||
W,
|
||||
H,
|
||||
aspectRatioMode=QtCore.Qt.AspectRatioMode.KeepAspectRatio,
|
||||
transformMode=QtCore.Qt.TransformationMode.SmoothTransformation,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user