Fix cover behaviour of thumbnails that are wider than taller (#6678)

lolsob-rspec
Eugen Rochko 2018-03-07 12:02:05 +01:00 committed by GitHub
parent 03b03fa30a
commit 62d18a3f9b
1 changed files with 8 additions and 0 deletions

View File

@ -167,6 +167,14 @@ class Item extends React.PureComponent {
vShift = shiftToPoint(widthRatio, (containerHeight * (height / 100)), originalHeight, focusY, true); vShift = shiftToPoint(widthRatio, (containerHeight * (height / 100)), originalHeight, focusY, true);
} }
if (originalWidth > originalHeight) {
imageStyle.height = '100%';
imageStyle.width = 'auto';
} else {
imageStyle.height = 'auto';
imageStyle.width = '100%';
}
imageStyle.top = vShift; imageStyle.top = vShift;
imageStyle.left = hShift; imageStyle.left = hShift;
} else { } else {