diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2019-07-11 18:14:36 -0400 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-07-11 18:14:36 -0400 |
commit | 1d93275d4202e1243c6c9349114b18c76ed45bbb (patch) | |
tree | ea17225c58def44a7f83d2234bf8dae73538b398 /src/new_fields/Doc.ts | |
parent | 8bd402c9ac403fdaed9b532d02094c08f9622ab3 (diff) | |
parent | aeb0521e8ad8f1efc8c3a39af9eb5443c5368453 (diff) |
merged with master
Diffstat (limited to 'src/new_fields/Doc.ts')
-rw-r--r-- | src/new_fields/Doc.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index c9937af87..0e5f8b4d9 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -276,8 +276,11 @@ export namespace Doc { return true; } - export function ComputeContentBounds(doc: Doc) { - let bounds = DocListCast(doc.data).reduce((bounds, doc) => { + // + // Computes the bounds of the contents of a set of documents. + // + export function ComputeContentBounds(docList: Doc[]) { + let bounds = docList.reduce((bounds, doc) => { var [sptX, sptY] = [NumCast(doc.x), NumCast(doc.y)]; let [bptX, bptY] = [sptX + doc[WidthSym](), sptY + doc[HeightSym]()]; return { @@ -384,7 +387,7 @@ export namespace Doc { } let layout = StrCast(fieldLayoutDoc.layout).replace(/fieldKey={"[^"]*"}/, `fieldKey={"${metaKey}"}`); if (backgroundLayout) { - layout = StrCast(fieldLayoutDoc.layout).replace(/fieldKey={"annotations"}/, `fieldKey={"${metaKey}"} fieldExt={"annotations"}`); + layout = StrCast(fieldLayoutDoc.layout).replace(/fieldKey={"[^"]*"}/, `fieldKey={"${metaKey}"} fieldExt={"annotations"}`); backgroundLayout = backgroundLayout.replace(/fieldKey={"[^"]*"}/, `fieldKey={"${metaKey}"}`); } let nw = Cast(fieldTemplate.nativeWidth, "number"); |