From 8475b309106d519a2d541b7cd61f22ac44b6392d Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Sun, 29 Mar 2020 13:27:36 -0400 Subject: more tweaks to embedded documents in text. fixes for expandedTemplate to show the original doc (not dataDoc). got rid of imgPath in imageBox. --- src/client/views/nodes/ImageBox.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 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 04ebf477b..68eb4493a 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -258,10 +258,9 @@ export class ImageBox extends DocAnnotatableComponent 0.05 || imgPath !== cachedImgPath) { + if (!cachedNativeSize.width || !cachedNativeSize.height || Math.abs(NumCast(this.layoutDoc._width) / NumCast(this.layoutDoc._height) - cachedNativeSize.width / cachedNativeSize.height) > 0.05) { if (!this.layoutDoc.isTemplateDoc || this.dataDoc !== this.layoutDoc) { requestImageSize(imgPath).then((inquiredSize: any) => { const rotation = NumCast(this.dataDoc[this.fieldKey + "-rotation"]) % 180; @@ -273,7 +272,6 @@ export class ImageBox extends DocAnnotatableComponent console.log(err)); } else if (Math.abs(1 - docAspect / cachedAspect) > 0.1) { -- cgit v1.2.3-70-g09d2