aboutsummaryrefslogtreecommitdiff
path: root/src/fields
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-10-21 00:41:23 -0400
committerbobzel <zzzman@gmail.com>2023-10-21 00:41:23 -0400
commit661c1367d27fa23c3aeb62369e92cd36eb5edabd (patch)
tree6887e62707fae03149bc2bbaec38c30e2a944f82 /src/fields
parent3ba733ffffb3036ea941bdbb5baf4c79bc7764af (diff)
change to doc decorations to be more "lightweight". made linkBox render links in a freeform view as a DocView. added an auto-reset view option for freeforms. fixed highlighting ink strokes. Made groups behave better for selecting things 'inside' the group bounding box that aren't in the group. Added vertically centered text option.
Diffstat (limited to 'src/fields')
-rw-r--r--src/fields/Doc.ts16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 9e3eb28f9..feacdc9c5 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -687,16 +687,12 @@ export namespace Doc {
*/
export function ComputeContentBounds(docList: Doc[]) {
const bounds = docList.reduce(
- (bounds, doc) => {
- const [sptX, sptY] = [NumCast(doc.x), NumCast(doc.y)];
- const [bptX, bptY] = [sptX + doc[Width](), sptY + doc[Height]()];
- return {
- x: Math.min(sptX, bounds.x),
- y: Math.min(sptY, bounds.y),
- r: Math.max(bptX, bounds.r),
- b: Math.max(bptY, bounds.b),
- };
- },
+ (bounds, doc) => ({
+ x: Math.min(NumCast(doc.x), bounds.x),
+ y: Math.min(NumCast(doc.y), bounds.y),
+ r: Math.max(NumCast(doc.x) + doc[Width](), bounds.r),
+ b: Math.max(NumCast(doc.y) + doc[Height](), bounds.b),
+ }),
{ x: Number.MAX_VALUE, y: Number.MAX_VALUE, r: -Number.MAX_VALUE, b: -Number.MAX_VALUE }
);
return bounds;