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/collections/CollectionStackingView.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/collections/CollectionStackingView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionStackingView.tsx | 8 | 
1 files changed, 3 insertions, 5 deletions
| diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index b9a94642a..84173d3ba 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -12,7 +12,7 @@ import { listSpec, makeInterface } from "../../../fields/Schema";  import { SchemaHeaderField } from "../../../fields/SchemaHeaderField";  import { BoolCast, Cast, NumCast, ScriptCast, StrCast } from "../../../fields/Types";  import { TraceMobx } from "../../../fields/util"; -import { emptyFunction, returnFalse, returnOne, returnZero, setupMoveUpEvents, Utils, smoothScroll } from "../../../Utils"; +import { emptyFunction, returnFalse, returnOne, returnZero, setupMoveUpEvents, Utils, smoothScroll, returnVal } from "../../../Utils";  import { DragManager, dropActionType } from "../../util/DragManager";  import { Transform } from "../../util/Transform";  import { undoBatch } from "../../util/UndoManager"; @@ -209,8 +209,6 @@ export class CollectionStackingView extends CollectionSubView(StackingDocument)              renderDepth={this.props.renderDepth + 1}              PanelWidth={width}              PanelHeight={height} -            NativeHeight={returnZero} -            NativeWidth={returnZero}              fitToBox={false}              dontRegisterView={dataDoc ? true : BoolCast(this.layoutDoc.dontRegisterChildViews, this.props.dontRegisterView)}              rootSelected={this.rootSelected} @@ -481,8 +479,8 @@ export class CollectionStackingView extends CollectionSubView(StackingDocument)      } -    @computed get nativeWidth() { return NumCast(this.layoutDoc._nativeWidth) || this.props.NativeWidth() || 0; } -    @computed get nativeHeight() { return NumCast(this.layoutDoc._nativeHeight) || this.props.NativeHeight() || 0; } +    @computed get nativeWidth() { return returnVal(this.props.NativeWidth?.(), NumCast(this.layoutDoc._nativeWidth)); } +    @computed get nativeHeight() { return returnVal(this.props.NativeHeight?.(), NumCast(this.layoutDoc._nativeHeight)); }      @computed get scaling() { return !this.nativeWidth ? 1 : this.props.PanelHeight() / this.nativeHeight; } | 
