From bb154f6c0c15cc0d63e6b31480f6c394814e328e Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 30 Nov 2021 23:45:53 -0500 Subject: from last --- src/client/views/InkingStroke.tsx | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx index 0b3619b22..fc1727055 100644 --- a/src/client/views/InkingStroke.tsx +++ b/src/client/views/InkingStroke.tsx @@ -94,6 +94,10 @@ export class InkingStroke extends ViewBoxBaseComponent wasSelected && (InkStrokeProperties.Instance._currentPoint = -1))); } + /** + * @param scrPt a point in the screen coordinate space + * @returns the point in the ink data's coordinate space. + */ ptFromScreen = (scrPt: { X: number, Y: number }) => { const { inkScaleX, inkScaleY, inkStrokeWidth, inkTop, inkLeft } = this.inkScaledData(); const docPt = this.props.ScreenToLocalTransform().transformPoint(scrPt.X, scrPt.Y); @@ -165,6 +173,11 @@ export class InkingStroke extends ViewBoxBaseComponent { const { inkScaleX, inkScaleY, inkStrokeWidth, inkTop, inkLeft } = this.inkScaledData(); const docPt = { @@ -226,7 +239,16 @@ export class InkingStroke extends ViewBoxBaseComponent this._nearestScrPt; + + /** + * @param boundsLeft the screen space left coordinate of the ink stroke + * @param boundsTop the screen space top coordinate of the ink stroke + * @returns the JSX controls for displaying an editing UI for the stroke (control point & tangent handles) + */ componentUI = (boundsLeft: number, boundsTop: number) => { const inkDoc = this.props.Document; const screenSpaceCenterlineStrokeWidth = 3; // the width of the blue line widget that shows the centerline of the ink stroke @@ -297,7 +319,6 @@ export class InkingStroke extends ViewBoxBaseComponent