diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-09-19 21:53:37 +0530 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-09-19 21:53:37 +0530 |
commit | 3dc37b033e4218464019e10ea59a66249b2675a7 (patch) | |
tree | 831c6c35afdb9529fc4d6ab015ee820e48900de6 /src/client/views/nodes/ImageBox.tsx | |
parent | b319375bef76275aceb9f46f208018927475fcce (diff) | |
parent | 7a12eccf31f0a04800b0ddd47cd18fcbcfcadb93 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into acls_uv
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r-- | src/client/views/nodes/ImageBox.tsx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index ce056b80c..c2662b35b 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -210,15 +210,12 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps, ImageD choosePath(url: URL) { const lower = url.href.toLowerCase(); - if (url.protocol === "data") { - return url.href; - } else if (url.href.indexOf(window.location.origin) === -1) { - return Utils.CorsProxy(url.href); - } else if (!/\.(png|jpg|jpeg|gif|webp)$/.test(lower)) { - return url.href;//Why is this here - } + if (url.protocol === "data") return url.href; + if (url.href.indexOf(window.location.origin) === -1) return Utils.CorsProxy(url.href); + if (!/\.(png|jpg|jpeg|gif|webp)$/.test(lower)) return url.href; //Why is this here + const ext = path.extname(url.href); - this._curSuffix = this.props.renderDepth < 1 ? "_o" : this.layoutDoc[WidthSym]() < 100 ? "_s" : "_m"; + this._curSuffix = this.props.renderDepth < 1 ? "_o" : this.props.PanelWidth() < 100 ? "_s" : "_m"; return url.href.replace(ext, this._curSuffix + ext); } @@ -323,8 +320,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps, ImageD @computed get nativeSize() { TraceMobx(); - const pw = this.props.PanelWidth?.() || 50; - const nativeWidth = NumCast(this.dataDoc[this.fieldKey + "-nativeWidth"], pw); + const nativeWidth = NumCast(this.dataDoc[this.fieldKey + "-nativeWidth"], 500); const nativeHeight = NumCast(this.dataDoc[this.fieldKey + "-nativeHeight"], 1); const nativeOrientation = NumCast(this.dataDoc[this.fieldKey + "-nativeOrientation"], 1); return { nativeWidth, nativeHeight, nativeOrientation }; |