aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/InkingStroke.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-08-08 12:27:40 -0400
committerbobzel <zzzman@gmail.com>2024-08-08 12:27:40 -0400
commit4574b7f03ccc85c4bebdbfd9475788456086704f (patch)
treed23d30343541b9af029ef418492d629d3cc710d7 /src/client/views/InkingStroke.tsx
parente1db06d59d580aa640212a0d3a6aeecb9122bdf0 (diff)
many changes to add typing in place of 'any's etc
Diffstat (limited to 'src/client/views/InkingStroke.tsx')
-rw-r--r--src/client/views/InkingStroke.tsx22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx
index 784d252a3..2e82371cb 100644
--- a/src/client/views/InkingStroke.tsx
+++ b/src/client/views/InkingStroke.tsx
@@ -20,6 +20,7 @@
Most of the operations that can be performed on an InkStroke (eg delete a point, rotate, stretch) are implemented in the InkStrokeProperties helper class
*/
+import { Property } from 'csstype';
import { action, computed, IReactionDisposer, observable, reaction } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
@@ -28,6 +29,7 @@ import { Doc } from '../../fields/Doc';
import { InkData, InkField } from '../../fields/InkField';
import { BoolCast, Cast, NumCast, RTFCast, StrCast } from '../../fields/Types';
import { TraceMobx } from '../../fields/util';
+import { Gestures } from '../../pen-gestures/GestureTypes';
import { CognitiveServices } from '../cognitive_services/CognitiveServices';
import { Docs } from '../documents/Documents';
import { DocumentType } from '../documents/DocumentTypes';
@@ -35,7 +37,6 @@ import { InteractionUtils } from '../util/InteractionUtils';
import { SnappingManager } from '../util/SnappingManager';
import { UndoManager } from '../util/UndoManager';
import { ContextMenu } from './ContextMenu';
-import { ViewBoxInterface } from './ViewBoxInterface';
import { ViewBoxAnnotatableComponent } from './DocComponent';
import { Colors } from './global/globalEnums';
import { InkControlPtHandles, InkEndPtHandles } from './InkControlPtHandles';
@@ -46,6 +47,7 @@ import { FieldView, FieldViewProps } from './nodes/FieldView';
import { FormattedTextBox, FormattedTextBoxProps } from './nodes/formattedText/FormattedTextBox';
import { PinDocView, PinProps } from './PinFuncs';
import { StyleProp } from './StyleProp';
+import { ViewBoxInterface } from './ViewBoxInterface';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { INK_MASK_SIZE } = require('./global/globalCssVariables.module.scss'); // prettier-ignore
@@ -318,8 +320,8 @@ export class InkingStroke extends ViewBoxAnnotatableComponent<FieldViewProps>()
Colors.MEDIUM_BLUE,
screenInkWidth[0],
screenSpaceCenterlineStrokeWidth,
- StrCast(inkDoc.stroke_lineJoin),
- StrCast(this.layoutDoc.stroke_lineCap),
+ StrCast(inkDoc.stroke_lineJoin) as Property.StrokeLinejoin,
+ StrCast(this.layoutDoc.stroke_lineCap) as Property.StrokeLinecap,
StrCast(inkDoc.stroke_bezier),
'none',
startMarker,
@@ -328,7 +330,7 @@ export class InkingStroke extends ViewBoxAnnotatableComponent<FieldViewProps>()
StrCast(inkDoc.stroke_dash),
1,
1,
- '',
+ '' as Gestures,
'none',
1.0,
false
@@ -383,8 +385,8 @@ export class InkingStroke extends ViewBoxAnnotatableComponent<FieldViewProps>()
this.strokeColor,
inkStrokeWidth,
inkStrokeWidth,
- StrCast(this.layoutDoc.stroke_lineJoin),
- StrCast(this.layoutDoc.stroke_lineCap),
+ StrCast(this.layoutDoc.stroke_lineJoin) as Property.StrokeLinejoin,
+ StrCast(this.layoutDoc.stroke_lineCap) as Property.StrokeLinecap,
StrCast(this.layoutDoc.stroke_bezier),
!closed ? 'none' : fillColor === 'transparent' ? 'none' : fillColor,
startMarker,
@@ -393,7 +395,7 @@ export class InkingStroke extends ViewBoxAnnotatableComponent<FieldViewProps>()
StrCast(this.layoutDoc.stroke_dash),
inkScaleX,
inkScaleY,
- '',
+ '' as Gestures,
'none',
1.0,
false,
@@ -410,8 +412,8 @@ export class InkingStroke extends ViewBoxAnnotatableComponent<FieldViewProps>()
mask && color === 'transparent' ? this.strokeColor : (highlightColor ?? color),
inkStrokeWidth,
inkStrokeWidth + NumCast(this.layoutDoc.stroke_borderWidth) + (fillColor ? (closed ? higlightMargin : (highlightIndex ?? 0) + higlightMargin) : higlightMargin),
- StrCast(this.layoutDoc.stroke_lineJoin),
- StrCast(this.layoutDoc.stroke_lineCap),
+ StrCast(this.layoutDoc.stroke_lineJoin) as Property.StrokeLinejoin,
+ StrCast(this.layoutDoc.stroke_lineCap) as Property.StrokeLinecap,
StrCast(this.layoutDoc.stroke_bezier),
!closed || !fillColor || DashColor(fillColor).alpha() === 0 ? 'none' : fillColor,
startMarker,
@@ -420,7 +422,7 @@ export class InkingStroke extends ViewBoxAnnotatableComponent<FieldViewProps>()
StrCast(this.layoutDoc.stroke_dash),
inkScaleX,
inkScaleY,
- '',
+ '' as Gestures,
this._props.pointerEvents?.() ?? 'visiblePainted',
0.0,
false,