From d3492a9a8dd221cf0828f1011c718353278ce87b Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Sat, 7 Dec 2019 00:30:00 -0500 Subject: only call resize() once after an image is loaded to speed things up. --- src/client/views/nodes/ImageBox.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/client/views/nodes/ImageBox.tsx') diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index f60888929..4b3da3dae 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -215,6 +215,7 @@ export class ImageBox extends DocAnnotatableComponent { requestImageSize(srcpath) .then((size: any) => { @@ -223,11 +224,12 @@ export class ImageBox extends DocAnnotatableComponent 0.1)) { setTimeout(action(() => { + this._resized = true; this.Document.height = this.Document[WidthSym]() * aspect; this.Document.nativeHeight = realsize.height; this.Document.nativeWidth = realsize.width; }), 0); - } + } else this._resized = true; }) .catch((err: any) => console.log(err)); } @@ -315,7 +317,7 @@ export class ImageBox extends DocAnnotatableComponent
-- cgit v1.2.3-70-g09d2