diff options
author | tschicke-brown <tyler_schicke@brown.edu> | 2019-04-08 21:59:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-08 21:59:41 -0400 |
commit | fbb5f2c19ffd1278d31b432a74ec3ae747b85894 (patch) | |
tree | b6a4255bd3a0a3c30504639f3e0e7a48ebadd420 /src/client/views/nodes/CollectionFreeFormDocumentView.tsx | |
parent | a2135bcc0a995378aad0e71ade832a4d526a37f0 (diff) | |
parent | e963f324fe8436ff5fc8ee21cdf091b6265690f9 (diff) |
Merge pull request #81 from browngraphicslab/propsRefactor
Props refactor
Diffstat (limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')
-rw-r--r-- | src/client/views/nodes/CollectionFreeFormDocumentView.tsx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx index 1a0f0cbbd..dcf82ccd4 100644 --- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx +++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx @@ -52,14 +52,12 @@ export class CollectionFreeFormDocumentView extends React.Component<DocumentView this.props.Document.SetData(KeyStore.ZIndex, h, NumberField) } - contentScaling = () => { - return this.nativeWidth > 0 ? this.width / this.nativeWidth : 1; - } + contentScaling = () => this.nativeWidth > 0 ? this.width / this.nativeWidth : 1 - getTransform = (): Transform => { - return this.props.ScreenToLocalTransform(). - translate(-this.props.Document.GetNumber(KeyStore.X, 0), -this.props.Document.GetNumber(KeyStore.Y, 0)).scale(1 / this.contentScaling()); - } + getTransform = (): Transform => + this.props.ScreenToLocalTransform() + .translate(-this.props.Document.GetNumber(KeyStore.X, 0), -this.props.Document.GetNumber(KeyStore.Y, 0)) + .scale(1 / this.contentScaling()) @computed get docView() { |