diff options
author | andrewdkim <adkim414@gmail.com> | 2019-11-23 16:30:45 -0500 |
---|---|---|
committer | andrewdkim <adkim414@gmail.com> | 2019-11-23 16:30:45 -0500 |
commit | b5b45c7d8eb9e3056c71d9ca213cca7f2d9c792a (patch) | |
tree | e6a04ae7ea36d085607a90109e2698db8ac2e034 /src/new_fields/InkField.ts | |
parent | 8af45ed7f376981ce8f8b1c6d1b2fd3b1546a00e (diff) | |
parent | 3b37cc31bb09b11238868c34a38a8e99f508479f (diff) |
merge from master
Diffstat (limited to 'src/new_fields/InkField.ts')
-rw-r--r-- | src/new_fields/InkField.ts | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/new_fields/InkField.ts b/src/new_fields/InkField.ts index d94834e91..2d8bb582a 100644 --- a/src/new_fields/InkField.ts +++ b/src/new_fields/InkField.ts @@ -12,16 +12,12 @@ export enum InkTool { Scrubber } -export interface StrokeData { - pathData: Array<{ x: number, y: number }>; - color: string; - width: string; - tool: InkTool; - displayTimecode: number; - creationTime: 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 @@ -34,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]() { |