diff options
| author | bobzel <zzzman@gmail.com> | 2020-09-08 19:26:24 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-09-08 19:26:24 -0400 |
| commit | 483a4d35ba2c522b889c7bd9b839a0af131ec0bb (patch) | |
| tree | 3a0884933242089a38d37931fbb40253e7353ab7 /src/client/views/DocumentDecorations.tsx | |
| parent | 1f1ecb0b86d166c67388e560c6716079e16ea962 (diff) | |
updated the way NativeWidth/Height props work so that, when specified, they override locally specified values
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
| -rw-r--r-- | src/client/views/DocumentDecorations.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 81c1676b0..e5c6f0aa9 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -10,7 +10,7 @@ import { InkField } from "../../fields/InkField"; import { ScriptField } from '../../fields/ScriptField'; import { Cast, NumCast } from "../../fields/Types"; import { GetEffectiveAcl } from '../../fields/util'; -import { emptyFunction, returnFalse, setupMoveUpEvents, simulateMouseClick } from "../../Utils"; +import { emptyFunction, returnFalse, setupMoveUpEvents, simulateMouseClick, returnVal } from "../../Utils"; import { DocUtils, Docs } from "../documents/Documents"; import { DocumentType } from '../documents/DocumentTypes'; import { DragManager } from "../util/DragManager"; @@ -453,8 +453,8 @@ export class DocumentDecorations extends React.Component<{}, { value: string }> if (e.ctrlKey && !element.props.Document._nativeHeight) element.toggleNativeDimensions(); if (dX !== 0 || dY !== 0 || dW !== 0 || dH !== 0) { const doc = Document(element.rootDoc); - let nwidth = doc._nativeWidth || 0; - let nheight = doc._nativeHeight || 0; + let nwidth = returnVal(element.NativeWidth?.(), doc._nativeWidth); + let nheight = returnVal(element.NativeHeight?.(), doc._nativeHeight); const width = (doc._width || 0); let height = (doc._height || (nheight / nwidth * width)); height = !height || isNaN(height) ? 20 : height; |
