From d718a470402e56c4fbc4e5d84f5f5192b32eac88 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Sat, 1 Feb 2020 17:48:33 -0500 Subject: more presenetation cleanup --- .../views/presentationview/PresElementBox.tsx | 34 ++++++---------------- 1 file changed, 9 insertions(+), 25 deletions(-) (limited to 'src/client/views/presentationview/PresElementBox.tsx') diff --git a/src/client/views/presentationview/PresElementBox.tsx b/src/client/views/presentationview/PresElementBox.tsx index ab49fbf1e..dcc5247d5 100644 --- a/src/client/views/presentationview/PresElementBox.tsx +++ b/src/client/views/presentationview/PresElementBox.tsx @@ -162,40 +162,25 @@ export class PresElementBox extends DocExtendableComponent [xCord, yCord]; + embedHeight = () => this.props.PanelHeight() - NumCast(this.originalLayout.collapsedHeight); + embedWidth = () => this.props.PanelWidth() - 20; /** * The function that is responsible for rendering the a preview or not for this * presentation element. */ renderEmbeddedInline = () => { - if (!this.originalLayout.embedOpen || !this.targetDoc) { - return (null); - } - - const propDocWidth = NumCast(this.layoutDoc._nativeWidth); - const propDocHeight = NumCast(this.layoutDoc._nativeHeight); - const scale = () => 175 / NumCast(this.layoutDoc._nativeWidth, 175); - const layoutDoc = Doc.Layout(this.props.Document); - if (!layoutDoc.embeddedView) { - layoutDoc.embeddedView = Doc.MakeAlias(this.originalLayout); - (layoutDoc.embeddedView as Doc).layoutKey = "layout"; - } - const embedHeight = propDocHeight === 0 ? this.props.PanelHeight() - NumCast(this.originalLayout.collapsedHeight) : propDocHeight * scale(); - return ( -
+ return !this.originalLayout.embedOpen || !this.targetDoc ? (null) : +
this.props.PanelWidth() - 20} - PanelHeight={() => embedHeight} + PanelWidth={this.embedWidth} + PanelHeight={this.embedHeight} getTransform={Transform.Identity} active={this.props.active} moveDocument={this.props.moveDocument!} @@ -204,8 +189,7 @@ export class PresElementBox extends DocExtendableComponent
-
- ); +
; } render() { -- cgit v1.2.3-70-g09d2