landscape -> imageIsNotFlipped
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
b5d271759f
commit
255f996710
1 changed files with 3 additions and 3 deletions
|
@ -124,11 +124,11 @@ export default class ImageView extends React.Component<IProps, IState> {
|
||||||
|
|
||||||
const rotation = inputRotation || this.state.rotation;
|
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
|
// If the image is rotated take it into account
|
||||||
const width = landscape ? image.naturalWidth : image.naturalHeight;
|
const width = imageIsNotFlipped ? image.naturalWidth : image.naturalHeight;
|
||||||
const height = landscape ? image.naturalHeight : image.naturalWidth;
|
const height = imageIsNotFlipped ? image.naturalHeight : image.naturalWidth;
|
||||||
|
|
||||||
const zoomX = imageWrapper.clientWidth / width;
|
const zoomX = imageWrapper.clientWidth / width;
|
||||||
const zoomY = imageWrapper.clientHeight / height;
|
const zoomY = imageWrapper.clientHeight / height;
|
||||||
|
|
Loading…
Reference in a new issue