aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/Doc.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-09-05 12:00:18 -0400
committerbob <bcz@cs.brown.edu>2019-09-05 12:00:18 -0400
commit179b2c7c68e3d240f3f39083bdb686ad31761c04 (patch)
tree03da1a5f16585cf78d3909a163325a35e06db2e7 /src/new_fields/Doc.ts
parenta936f08e3c18ad34bbe74133eaa768c7bda832dc (diff)
fixed some template issues. added attribution for pasted text
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r--src/new_fields/Doc.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts
index a703f1cef..e7ef1dcd3 100644
--- a/src/new_fields/Doc.ts
+++ b/src/new_fields/Doc.ts
@@ -522,6 +522,7 @@ export namespace Doc {
otherdoc.type = DocumentType.TEMPLATE;
!templateDoc.nativeWidth && (otherdoc.nativeWidth = 0);
!templateDoc.nativeHeight && (otherdoc.nativeHeight = 0);
+ !templateDoc.nativeWidth && (otherdoc.ignoreAspect = true);
return otherdoc;
}
export function ApplyTemplateTo(templateDoc: Doc, target: Doc, targetData?: Doc) {
@@ -538,6 +539,7 @@ export namespace Doc {
target.nativeHeight = Doc.GetProto(target).nativeHeight = undefined;
!templateDoc.nativeWidth && (target.nativeWidth = 0);
!templateDoc.nativeHeight && (target.nativeHeight = 0);
+ !templateDoc.nativeHeight && (target.ignoreAspect = true);
target.width = templateDoc.width;
target.height = templateDoc.height;
target.onClick = templateDoc.onClick instanceof ObjectField && templateDoc.onClick[Copy]();
@@ -576,7 +578,7 @@ export namespace Doc {
/* move certain layout properties from the original data doc to the template layout to avoid
inheriting them from the template's data doc which may also define these fields for its own use.
*/
- fieldTemplate.ignoreAspect = BoolCast(fieldTemplate.ignoreAspect);
+ fieldTemplate.ignoreAspect = fieldTemplate.ignoreAspect === undefined ? undefined : BoolCast(fieldTemplate.ignoreAspect);
fieldTemplate.singleColumn = BoolCast(fieldTemplate.singleColumn);
fieldTemplate.nativeWidth = Cast(fieldTemplate.nativeWidth, "number");
fieldTemplate.nativeHeight = Cast(fieldTemplate.nativeHeight, "number");