File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -159,10 +159,10 @@ void ScalableImageLabel::paintEvent(QPaintEvent* event)
159
159
160
160
// Resize if max-zoomed image is smaller than the available area
161
161
resize |= MAX_ZOOM_RATIO * fullSizePixmap.width () < availableArea.width () && MAX_ZOOM_RATIO * fullSizePixmap.height () < availableArea.height ();
162
- // Resize if fill mode is active but the image isn't fit to the available area
163
- resize |= fillMode && (pixmap ().width () != availableArea.width () && pixmap ().height () != availableArea.height ());
164
- // Resize if fill mode is inactive but the image is smaller than the available area
165
- resize |= !fillMode && ( pixmap ().width () < availableArea.width () && pixmap ().height () < availableArea.height () );
162
+ // Resize if fill mode is active but the image is bigger than the available area
163
+ resize |= fillMode && (pixmap ().width () > availableArea.width () || pixmap ().height () > availableArea.height ());
164
+ // Resize if the image is smaller than the available area
165
+ resize |= pixmap ().width () < availableArea.width () && pixmap ().height () < availableArea.height ();
166
166
167
167
if (resize) {
168
168
setPixmap (fullSizePixmap.scaled (availableArea, Qt::KeepAspectRatio, Qt::SmoothTransformation));
You can’t perform that action at this time.
0 commit comments