landscape -> imageIsNotFlipped

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-06-07 15:46:03 +02:00
parent b5d271759f
commit 255f996710
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -124,11 +124,11 @@ export default class ImageView extends React.Component<IProps, IState> {
const rotation = inputRotation || this.state.rotation;
const landscape = rotation % 180 === 0;
const imageIsNotFlipped = rotation % 180 === 0;
// If the image is rotated take it into account
const width = landscape ? image.naturalWidth : image.naturalHeight;
const height = landscape ? image.naturalHeight : image.naturalWidth;
const width = imageIsNotFlipped ? image.naturalWidth : image.naturalHeight;
const height = imageIsNotFlipped ? image.naturalHeight : image.naturalWidth;
const zoomX = imageWrapper.clientWidth / width;
const zoomY = imageWrapper.clientHeight / height;