aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/DocumentView.tsx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index d59455935..6b305d179 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -445,16 +445,28 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
this.props.Document.customLayout = this.props.Document.layout;
this.props.Document.layout = this.props.Document.nativeLayout;
this.props.Document.type = this.props.Document.nativeType;
+ this.props.Document.nativeWidth = this.props.Document.nativeNativeWidth;
+ this.props.Document.nativeHeight = this.props.Document.nativeNativeHeight;
+ this.props.Document.ignoreAspect = this.props.Document.nativeIgnoreAspect;
this.props.Document.nativeLayout = undefined;
+ this.props.Document.nativeNativeWidth = undefined;
+ this.props.Document.nativeNativeHeight = undefined;
+ this.props.Document.nativeIgnoreAspect = undefined;
}
@undoBatch
makeCustomViewClicked = (): void => {
this.props.Document.nativeLayout = this.props.Document.layout;
this.props.Document.nativeType = this.props.Document.type;
- PromiseValue(this.props.Document.customLayout).then(custom => {
+ this.props.Document.nativeNativeWidth = this.props.Document.nativeWidth;
+ this.props.Document.nativeNativeHeight = this.props.Document.nativeHeight;
+ this.props.Document.nativeIgnoreAspect = this.props.Document.ignoreAspect;
+ PromiseValue(Cast(this.props.Document.customLayout, Doc)).then(custom => {
if (custom) {
this.props.Document.type = DocumentType.TEMPLATE;
this.props.Document.layout = custom;
+ !custom.nativeWidth && (this.props.Document.nativeWidth = 0);
+ !custom.nativeHeight && (this.props.Document.nativeHeight = 0);
+ !custom.nativeWidth && (this.props.Document.ignoreAspect = true);
} else {
let options = { title: "data", width: NumCast(this.props.Document.width), height: NumCast(this.props.Document.height) + 25, x: -NumCast(this.props.Document.width) / 2, y: -NumCast(this.props.Document.height) / 2, };
let fieldTemplate = this.props.Document.type === DocumentType.TEXT ? Docs.Create.TextDocument(options) : Docs.Create.ImageDocument("http://www.cs.brown.edu", options);