From ffa36a87eb1093883dcc80128b08d24d2440f75a Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 5 Aug 2020 13:01:52 -0400 Subject: fixed perfectly horizontal/vertical lines to display. make InkFields script editable. --- src/client/util/type_decls.d | 5 +++++ src/client/views/DocumentDecorations.tsx | 2 -- src/client/views/InkingStroke.tsx | 8 ++++---- src/fields/InkField.ts | 5 ++++- 4 files changed, 13 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/util/type_decls.d b/src/client/util/type_decls.d index 08aec3724..ab6c94f83 100644 --- a/src/client/util/type_decls.d +++ b/src/client/util/type_decls.d @@ -187,6 +187,11 @@ declare class List extends ObjectField { [Copy](): ObjectField; } +declare class InkField extends ObjectField { + constructor(data:Array<{X:number, Y:number}>); + [Copy](): ObjectField; +} + // @ts-ignore declare const console: any; diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 1ae7d6617..005df6fe0 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -68,8 +68,6 @@ export class DocumentDecorations extends React.Component<{}, { value: string }> private _prevY = 0; private _centerPoints: { X: number, Y: number }[] = []; private _inkDocs: { x: number, y: number, width: number, height: number }[] = []; - private _natWid = 0; - private _natHei = 0; @observable private _accumulatedTitle = ""; @observable private _titleControlString: string = "#title"; diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx index fe5bf1eb2..6c5eda256 100644 --- a/src/client/views/InkingStroke.tsx +++ b/src/client/views/InkingStroke.tsx @@ -99,10 +99,10 @@ export class InkingStroke extends ViewBoxBaseComponent `{X: ${i.X}, Y: ${i.Y}} `) + "])"; } [ToString]() { return "InkField"; } } + +Scripting.addGlobal("InkField", InkField); \ No newline at end of file -- cgit v1.2.3-70-g09d2