aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/InkField.ts
diff options
context:
space:
mode:
authorStanley Yip <33562077+yipstanley@users.noreply.github.com>2019-11-16 14:34:33 -0500
committerGitHub <noreply@github.com>2019-11-16 14:34:33 -0500
commit2231fc61a0a667c207ec3ca7156f7545cf909d17 (patch)
treec3ef95f57ff84c847aedd0125173b6c58cbeb239 /src/new_fields/InkField.ts
parent22d1e65236bae11c508d5c34ebcbddd1a552bfd8 (diff)
parent68c9c230b3c98ec70adaa1dacb66215f09d2c1f6 (diff)
Merge pull request #302 from browngraphicslab/interaction_stanley
Interaction Improvements
Diffstat (limited to 'src/new_fields/InkField.ts')
-rw-r--r--src/new_fields/InkField.ts20
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]() {