1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-05 23:10:41 +03:00

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

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;