Simplifie code a bit

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-05-06 16:41:09 +02:00
parent bb9803a94e
commit 7ad270928a
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
1 changed files with 2 additions and 5 deletions

View File

@ -120,11 +120,8 @@ export default class ImageView extends React.Component<IProps, IState> {
const image = this.image.current;
const imageWrapper = this.imageWrapper.current;
const width = image.naturalWidth;
const height = image.naturalHeight;
const zoomX = imageWrapper.clientWidth / width;
const zoomY = imageWrapper.clientHeight / height;
const zoomX = imageWrapper.clientWidth / image.naturalWidth;
const zoomY = imageWrapper.clientHeight / image.naturalHeight;
// If the image is smaller in both dimensions set its the zoom to 1 to
// display it in its original size