Browse Source

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

pull/4/head
Eugen Rochko 6 years ago
committed by GitHub
parent
commit
b170627ceb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      app/javascript/mastodon/components/media_gallery.js

+ 8
- 0
app/javascript/mastodon/components/media_gallery.js 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 {

Loading…
Cancel
Save