Use 'original' size for aspect ratio
This commit is contained in:
parent
a3b2e007d3
commit
01dcd9ac2a
1 changed files with 2 additions and 2 deletions
|
@ -296,7 +296,7 @@ class MediaGallery extends React.PureComponent {
|
||||||
getSizeDataSingle = () => {
|
getSizeDataSingle = () => {
|
||||||
const { media, defaultWidth } = this.props;
|
const { media, defaultWidth } = this.props;
|
||||||
const width = this.state.width || defaultWidth;
|
const width = this.state.width || defaultWidth;
|
||||||
const aspectRatio = media.getIn([0, 'meta', 'small', 'aspect']);
|
const aspectRatio = media.getIn([0, 'meta', 'original', 'aspect']);
|
||||||
|
|
||||||
const getHeight = () => {
|
const getHeight = () => {
|
||||||
if (!aspectRatio) return width*9/16;
|
if (!aspectRatio) return width*9/16;
|
||||||
|
@ -323,7 +323,7 @@ class MediaGallery extends React.PureComponent {
|
||||||
let itemsDimensions = [];
|
let itemsDimensions = [];
|
||||||
|
|
||||||
const ratios = Array(size).fill().map((_, i) =>
|
const ratios = Array(size).fill().map((_, i) =>
|
||||||
media.getIn([i, 'meta', 'small', 'aspect']),
|
media.getIn([i, 'meta', 'original', 'aspect']),
|
||||||
);
|
);
|
||||||
|
|
||||||
const [ar1, ar2, ar3, ar4] = ratios;
|
const [ar1, ar2, ar3, ar4] = ratios;
|
||||||
|
|
Loading…
Reference in a new issue