diff options
author | Stanley Yip <stanley_yip@brown.edu> | 2020-04-10 18:26:23 -0700 |
---|---|---|
committer | Stanley Yip <stanley_yip@brown.edu> | 2020-04-10 18:26:23 -0700 |
commit | 24d8fde04b562d474bb96669903fc42add2f9d84 (patch) | |
tree | 377f15bf179c9654f83786fba7f3c194f3f1d429 /src | |
parent | 044a5f28e03304ae74096643b14dc72588833489 (diff) |
some comments
Diffstat (limited to 'src')
-rw-r--r-- | src/client/util/InteractionUtils.tsx | 7 | ||||
-rw-r--r-- | src/pen-gestures/ndollar.ts | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/client/util/InteractionUtils.tsx b/src/client/util/InteractionUtils.tsx index f2d569cf3..7e41b3744 100644 --- a/src/client/util/InteractionUtils.tsx +++ b/src/client/util/InteractionUtils.tsx @@ -13,7 +13,6 @@ export namespace InteractionUtils { export class MultiTouchEvent<T extends React.TouchEvent | TouchEvent> { constructor( readonly fingers: number, - // readonly points: T extends React.TouchEvent ? React.TouchList : TouchList, readonly targetTouches: T extends React.TouchEvent ? React.Touch[] : Touch[], readonly touches: T extends React.TouchEvent ? React.Touch[] : Touch[], readonly changedTouches: T extends React.TouchEvent ? React.Touch[] : Touch[], @@ -48,6 +47,11 @@ export namespace InteractionUtils { }; } + /** + * Turns an element onto a target for custom touch handling. + * @param element - element to add events to + * @param func - function to add to the event + */ export function MakeHoldTouchTarget( element: HTMLElement, func: (e: Event, me: MultiTouchEvent<React.TouchEvent>) => void @@ -78,7 +82,6 @@ export namespace InteractionUtils { return myTouches; } - // TODO: find a way to reference this function from InkingStroke instead of copy pastign here. copied bc of weird error when on mobile view export function CreatePolyline(points: { X: number, Y: number }[], left: number, top: number, color: string, width: number) { const pts = points.reduce((acc: string, pt: { X: number, Y: number }) => acc + `${pt.X - left},${pt.Y - top} `, ""); return ( diff --git a/src/pen-gestures/ndollar.ts b/src/pen-gestures/ndollar.ts index bb92f62e1..e5740d105 100644 --- a/src/pen-gestures/ndollar.ts +++ b/src/pen-gestures/ndollar.ts @@ -161,6 +161,9 @@ const AngleSimilarityThreshold = Deg2Rad(30.0); export class NDollarRecognizer { public Multistrokes: Multistroke[]; + /** + * @IMPORTANT - IF YOU'RE ADDING A NEW GESTURE, BE SURE TO INCREMENT THE NumMultiStrokes CONST RIGHT ABOVE THIS CLASS. + */ constructor(useBoundedRotationInvariance: boolean) // constructor { // |