diff options
| author | Sam Wilkins <samwilkins333@gmail.com> | 2019-11-19 11:28:49 -0500 |
|---|---|---|
| committer | Sam Wilkins <samwilkins333@gmail.com> | 2019-11-19 11:28:49 -0500 |
| commit | 3f86ea5556ab7a1fc13cd9c74ef4305f2f5cd778 (patch) | |
| tree | 4d13f3401ecc80fb5bce22d2a3382545102fda7f /src/new_fields/InkField.ts | |
| parent | 611bb858265b6667f2b7db858d183cea16f273aa (diff) | |
| parent | d259cf7b16e64794bc12ae420f9b512a75eee46c (diff) | |
merged with master
Diffstat (limited to 'src/new_fields/InkField.ts')
| -rw-r--r-- | src/new_fields/InkField.ts | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/new_fields/InkField.ts b/src/new_fields/InkField.ts index e381d0218..2d8bb582a 100644 --- a/src/new_fields/InkField.ts +++ b/src/new_fields/InkField.ts @@ -8,18 +8,16 @@ export enum InkTool { None, Pen, Highlighter, - Eraser + Eraser, + Scrubber } -export interface StrokeData { - pathData: Array<{ x: number, y: number }>; - color: string; - width: string; - tool: InkTool; - displayTimecode: number; +export interface PointData { + x: number; + y: number; } -export type InkData = Map<string, StrokeData>; +export type InkData = Array<PointData>; const pointSchema = createSimpleSchema({ x: true, y: true @@ -32,16 +30,16 @@ const strokeDataSchema = createSimpleSchema({ @Deserializable("ink") export class InkField extends ObjectField { - @serializable(map(object(strokeDataSchema))) + @serializable(list(object(strokeDataSchema))) readonly inkData: InkData; - constructor(data?: InkData) { + constructor(data: InkData) { super(); - this.inkData = data || new Map; + this.inkData = data; } [Copy]() { - return new InkField(DeepCopy(this.inkData)); + return new InkField(this.inkData); } [ToScriptString]() { |
