diff options
author | bobzel <zzzman@gmail.com> | 2021-09-27 14:40:30 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-09-27 14:40:30 -0400 |
commit | 6547bbc949b8333fc1dd86e11ecda5d98ae4a8d9 (patch) | |
tree | 317594efd0ddba018eb3f345bbf81dd8e32d85aa /src/client/views/nodes/DocumentView.tsx | |
parent | b3c6f5c4abb93c6178bb3d90aa68fad86e690097 (diff) | |
parent | eb529611c97c9936577697b829c50b4ca0736c6e (diff) |
Merge branch 'master' into temporalmedia-mehek
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 3d1ad867f..04c559bdd 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -1148,10 +1148,10 @@ export class DocumentView extends React.Component<DocumentViewProps> { @computed get nativeScaling() { if (this.shouldNotScale) return 1; const minTextScale = this.Document.type === DocumentType.RTF ? 0.1 : 0; - if (this.fitWidth || this.props.PanelHeight() / this.effectiveNativeHeight > this.props.PanelWidth() / this.effectiveNativeWidth) { - return Math.max(minTextScale, this.props.PanelWidth() / this.effectiveNativeWidth); // width-limited or fitWidth + if (this.fitWidth || this.props.PanelHeight() / (this.effectiveNativeHeight || 1) > this.props.PanelWidth() / (this.effectiveNativeWidth || 1)) { + return Math.max(minTextScale, this.props.PanelWidth() / (this.effectiveNativeWidth || 1)); // width-limited or fitWidth } - return Math.max(minTextScale, this.props.PanelHeight() / this.effectiveNativeHeight); // height-limited or unscaled + return Math.max(minTextScale, this.props.PanelHeight() / (this.effectiveNativeHeight || 1)); // height-limited or unscaled } @computed get panelWidth() { return this.effectiveNativeWidth ? this.effectiveNativeWidth * this.nativeScaling : this.props.PanelWidth(); } |