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.ts15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index edf72e45b..1ea9b1dcc 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -1042,7 +1042,18 @@ export namespace Docs {
return linkDoc;
}
- export function InkDocument(color: string, strokeWidth: number, stroke_bezier: string, fillColor: string, arrowStart: string, arrowEnd: string, dash: string, points: PointData[], isInkMask: boolean, options: DocumentOptions = {}) {
+ export function InkDocument(
+ points: PointData[],
+ options: DocumentOptions = {},
+ strokeWidth = ActiveInkWidth(),
+ color = ActiveInkColor(),
+ stroke_bezier = ActiveInkBezierApprox(),
+ fillColor = ActiveFillColor(),
+ arrowStart = ActiveArrowStart(),
+ arrowEnd = ActiveArrowEnd(),
+ dash = ActiveDash(),
+ isInkMask = ActiveIsInkMask()
+ ) {
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
@@ -1526,7 +1537,7 @@ export namespace DocUtils {
created = Docs.Create.AudioDocument(field.url.href, resolved);
created.layout = AudioBox.LayoutString(fieldKey);
} else if (field instanceof InkField) {
- created = Docs.Create.InkDocument(ActiveInkColor(), ActiveInkWidth(), ActiveInkBezierApprox(), ActiveFillColor(), ActiveArrowStart(), ActiveArrowEnd(), ActiveDash(), field.inkData, ActiveIsInkMask(), resolved);
+ created = Docs.Create.InkDocument(field.inkData, resolved);
created.layout = InkingStroke.LayoutString(fieldKey);
} else if (field instanceof List && field[0] instanceof Doc) {
created = Docs.Create.StackingDocument(DocListCast(field), resolved);