mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-20 19:45:02 +01:00
Fix cover behaviour of thumbnails that are wider than taller (#6678)
This commit is contained in:
parent
a1b065700a
commit
b170627ceb
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user