aboutsummaryrefslogtreecommitdiff
path: root/src/client/documents/Documents.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r--src/client/documents/Documents.ts26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 5c913513a..4086ede20 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -670,7 +670,15 @@ export namespace Docs {
{
// NOTE: this is unused!! ink fields are filled in directly within the InkDocument() method
layout: { view: InkingStroke, dataField: 'stroke' },
- options: { systemIcon: 'BsFillPencilFill', nativeDimModifiable: true, nativeHeightUnfrozen: true, layout_isSvg: true, layout_forceReflow: true },
+ options: {
+ systemIcon: 'BsFillPencilFill', //
+ nativeDimModifiable: true,
+ nativeHeightUnfrozen: true,
+ layout_hideDecorationTitle: true, // don't show title when selected
+ fitWidth: false,
+ layout_isSvg: true,
+ layout_forceReflow: true,
+ },
},
],
[
@@ -1035,16 +1043,8 @@ export namespace Docs {
}
export function InkDocument(color: string, strokeWidth: number, stroke_bezier: string, fillColor: string, arrowStart: string, arrowEnd: string, dash: string, points: PointData[], isInkMask: boolean, options: DocumentOptions = {}) {
- const I = new Doc();
- I[Initializing] = true;
- I.type = DocumentType.INK;
- I.layout = InkingStroke.LayoutString('stroke');
- I.nativeDimModifiable = true;
- I.nativeHeightUnfrozen = true;
- I.layout_isSvg = true;
- I.layout_forceReflow = true;
- I.layout_fitWidth = false;
- I.layout_hideDecorationTitle = true; // don't show title when selected
+ const ink = InstanceFromProto(Prototypes.get(DocumentType.INK), '', { title: 'ink', ...options });
+ const I = Doc.GetProto(ink);
// I.layout_hideOpenButton = true; // don't show open full screen button when selected
I.color = color;
I.fillColor = fillColor;
@@ -1056,8 +1056,6 @@ export namespace Docs {
I.stroke_dash = dash;
I.stroke_isInkMask = isInkMask;
I.text_align = 'center';
- I.title = 'ink';
- I.author = Doc.CurrentUserEmail;
I.rotation = 0;
I.defaultDoubleClick = 'click';
I.author_date = new DateField();
@@ -1065,7 +1063,7 @@ export namespace Docs {
//I['acl-Override'] = SharingPermissions.Unset;
I[Initializing] = false;
- return InstanceFromProto(I, '', options);
+ return ink;
}
export function PdfDocument(url: string, options: DocumentOptions = {}, overwriteDoc?: Doc) {