Fix aspect ratio.

This commit is contained in:
Bill Thiede 2023-02-16 19:29:55 -08:00
parent 1f5a377194
commit 321fe4caa6

View File

@ -208,7 +208,7 @@ class App extends React.Component {
images = imageMetadata.map((metadata) => { images = imageMetadata.map((metadata) => {
let {name, ratio, image, size} = metadata; let {name, ratio, image, size} = metadata;
let width = ELEMENT_WIDTH; let width = ELEMENT_WIDTH;
let height = (ratio * width).toFixed(); let height = (width/ratio).toFixed();
let url = ROOT + image + '?t=' + timestamp; let url = ROOT + image + '?t=' + timestamp;
const clamp = (offsetX, offsetY) => { const clamp = (offsetX, offsetY) => {
@ -288,7 +288,7 @@ class App extends React.Component {
onWheel={mouseScroll} onWheel={mouseScroll}
className="frame" className="frame"
style={{backgroundImage: 'url("' + url + '")', ...style}}> style={{backgroundImage: 'url("' + url + '")', ...style}}>
<p className="name">{name}</p> <p className="name"><a href={url}>{name}</a></p>
</div>) </div>)
}); });
let time = moment.unix(timestamp); let time = moment.unix(timestamp);