diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2020-03-29 13:27:36 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2020-03-29 13:27:36 -0400 |
commit | 8475b309106d519a2d541b7cd61f22ac44b6392d (patch) | |
tree | dbf70ef4688348ad8525f5d60359d7ddc3e423b7 /src/client/views/nodes/ImageBox.tsx | |
parent | 089011c748e67fcce407021c6c28dc5028303a45 (diff) |
more tweaks to embedded documents in text. fixes for expandedTemplate to show the original doc (not dataDoc). got rid of imgPath in imageBox.
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r-- | src/client/views/nodes/ImageBox.tsx | 4 |
1 files changed, 1 insertions, 3 deletions
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<FieldViewProps, ImageDocum width: NumCast(this.dataDoc[this.fieldKey + "-nativeWidth"]), height: NumCast(this.dataDoc[this.fieldKey + "-nativeHeight"]) }; - const cachedImgPath = this.dataDoc[this.fieldKey + "-imgPath"]; const docAspect = this.Document[HeightSym]() / this.Document[WidthSym](); const cachedAspect = cachedNativeSize.height / cachedNativeSize.width; - if (!cachedNativeSize.width || !cachedNativeSize.height || Math.abs(NumCast(this.layoutDoc._width) / NumCast(this.layoutDoc._height) - cachedNativeSize.width / cachedNativeSize.height) > 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<FieldViewProps, ImageDocum this.dataDoc[this.fieldKey + "-nativeWidth"] = this.Document._nativeWidth = rotatedNativeSize.width; this.dataDoc[this.fieldKey + "-nativeHeight"] = this.Document._nativeHeight = rotatedNativeSize.height; } - this.dataDoc[this.fieldKey + "-imgPath"] = imgPath; }), 0); }).catch((err: any) => console.log(err)); } else if (Math.abs(1 - docAspect / cachedAspect) > 0.1) { |