mirror of
https://github.com/vector-im/element-web.git
synced 2025-11-29 06:21:20 +01:00
Simplifie code a bit
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
9a5a3b30ca
commit
3b97e52246
@ -118,11 +118,8 @@ export default class ImageView extends React.Component<IProps, IState> {
|
|||||||
const image = this.image.current;
|
const image = this.image.current;
|
||||||
const imageWrapper = this.imageWrapper.current;
|
const imageWrapper = this.imageWrapper.current;
|
||||||
|
|
||||||
const width = image.naturalWidth;
|
const zoomX = imageWrapper.clientWidth / image.naturalWidth;
|
||||||
const height = image.naturalHeight;
|
const zoomY = imageWrapper.clientHeight / image.naturalHeight;
|
||||||
|
|
||||||
const zoomX = imageWrapper.clientWidth / width;
|
|
||||||
const zoomY = imageWrapper.clientHeight / height;
|
|
||||||
|
|
||||||
// If the image is smaller in both dimensions set its the zoom to 1 to
|
// If the image is smaller in both dimensions set its the zoom to 1 to
|
||||||
// display it in its original size
|
// display it in its original size
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user