Skip to content

Commit

Permalink
Handle square or landscape thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed Apr 11, 2022
1 parent 87c18ff commit f19e3e8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/images/Images.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import sizeMe from 'react-sizeme'

const imgStyle = {
padding: 2,
width: '100%',
maxWidth: '100%',
maxHeight: '100%',
}

// size props come from sizeMe() HOC below
Expand Down Expand Up @@ -97,6 +95,7 @@ const Images = ({ sortBy, sortReverse, size }) => {
// Known dimensions of roi-thumbnails
const roiThumbAspect = 250 / 166;
const thumbHeight = thumbSize / roiThumbAspect;
imgStyle.height = thumbHeight;

const Cell = ({ columnIndex, rowIndex, style }) => {
let row = filteredData[(rowIndex * colCount) + columnIndex];
Expand Down

0 comments on commit f19e3e8

Please sign in to comment.