diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-09-25 00:16:55 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-09-25 00:16:55 -0400 |
commit | b69106994f5450e2ac2c515f28dacceb2e13b78b (patch) | |
tree | c024c795d0ee7e488bd0aafead0c80b5b1617c9b /src/client/views/nodes/CollectionFreeFormDocumentView.tsx | |
parent | e2ab8ba370ecd01a4327492a491c4fa88de09eaf (diff) |
refactored collection view to be cleaner and more modular for supporting things like PivotView. fixed pivot view selection bug.
Diffstat (limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/CollectionFreeFormDocumentView.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx index 0d9ace473..b30055071 100644 --- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx +++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx @@ -41,7 +41,6 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF @computed get dataProvider() { return this.props.dataProvider && this.props.dataProvider(this.props.Document, this.props.DataDoc) ? this.props.dataProvider(this.props.Document, this.props.DataDoc) : undefined; } @computed get nativeWidth() { return FieldValue(this.Document.nativeWidth, 0); } @computed get nativeHeight() { return FieldValue(this.Document.nativeHeight, 0); } - @computed get scaleToOverridingWidth() { return this.width / FieldValue(this.Document.width, this.width); } @computed get renderScriptDim() { if (this.Document.renderScript) { @@ -74,7 +73,7 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF panelHeight = () => this.props.PanelHeight(); getTransform = (): Transform => this.props.ScreenToLocalTransform() .translate(-this.X, -this.Y) - .scale(1 / this.contentScaling()).scale(1 / this.scaleToOverridingWidth) + .scale(1 / this.contentScaling()) borderRounding = () => { let ruleRounding = this.props.ruleProvider ? StrCast(this.props.ruleProvider["ruleRounding_" + this.Document.heading]) : undefined; @@ -100,9 +99,10 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF @observable _animPos: number[] | undefined = undefined; + finalPanelWidh = () => { return this.dataProvider ? this.dataProvider.width : this.panelWidth(); } + finalPanelHeight = () => { return this.dataProvider ? this.dataProvider.height : this.panelHeight(); } + render() { - console.log("this.props =" + this.props.dataProvider); - trace(); return ( <div className="collectionFreeFormDocumentView-container" style={{ @@ -123,8 +123,8 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF ContentScaling={this.contentScaling} ScreenToLocalTransform={this.getTransform} backgroundColor={this.clusterColorFunc} - PanelWidth={this.panelWidth} - PanelHeight={this.panelHeight} + PanelWidth={this.finalPanelWidh} + PanelHeight={this.finalPanelHeight} /> </div> ); |