aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/Doc.ts
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-09-06 01:42:32 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-09-06 01:42:32 -0400
commit760465b0723e2b21a07269afe61a0207a0bc5580 (patch)
treefcfac8c7495ea95096a22aba401fc99cb6d17a13 /src/new_fields/Doc.ts
parente5b52b1083c86b946a2758983e397826579d2282 (diff)
parent717e32f8f140127a628c5ea4b7543c1703459e15 (diff)
merged
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 1462cdfad..be4bf232b 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");