From 89c8891e9def96a871d36ab7772e453b8d8c21c1 Mon Sep 17 00:00:00 2001 From: vkalev Date: Fri, 2 Jul 2021 11:58:06 -0500 Subject: indicator appears on hover for ink control points to be added --- src/client/views/InkControl.tsx | 8 +++----- src/client/views/InkingStroke.tsx | 23 ++++++++++++++++++----- 2 files changed, 21 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/client/views/InkControl.tsx b/src/client/views/InkControl.tsx index ae0fc0b22..accb16f61 100644 --- a/src/client/views/InkControl.tsx +++ b/src/client/views/InkControl.tsx @@ -51,8 +51,7 @@ export class InkControl extends React.Component { } /** - * Deletes the currently selected points. - * @param e Keyboard Event. + * Deletes the currently selected point. */ @action onDelete = (e: KeyboardEvent) => { @@ -63,7 +62,6 @@ export class InkControl extends React.Component { /** * Changes the current selected control point. - * @param i The number of the point to be selected. */ @action changeCurrPoint = (i: number) => { @@ -85,8 +83,8 @@ export class InkControl extends React.Component { return ( (InkDocument) { private _controlUndo?: UndoManager.Batch; + @observable private _overAddPoint = -1; + + static readonly MaskDim = 50000; public static LayoutString(fieldStr: string) { return FieldView.LayoutString(InkingStroke, fieldStr); } @@ -34,6 +37,17 @@ export class InkingStroke extends ViewBoxBaseComponent { + this._overAddPoint = i; + } + + @action + onPointerLeave = () => { + this._overAddPoint = -1; + } + + @action public static toggleMask = (inkDoc: Doc) => { inkDoc.isInkMask = !inkDoc.isInkMask; @@ -91,7 +105,6 @@ export class InkingStroke extends ViewBoxBaseComponent 1 && lineRgt - lineLft > 1, false); - const selectedLine = InteractionUtils.CreatePolyline(data, lineLft - strokeWidth * 4 * scaleX, lineTop - strokeWidth * 4 * scaleX, "#1F85DE", strokeWidth / 6, strokeWidth / 6, + const selectedLine = InteractionUtils.CreatePolyline(data, lineLft - strokeWidth * 3, lineTop - strokeWidth * 3, "#1F85DE", strokeWidth / 6, strokeWidth / 6, StrCast(this.layoutDoc.strokeBezier), StrCast(this.layoutDoc.fillColor, "none"), StrCast(this.layoutDoc.strokeStartMarker), StrCast(this.layoutDoc.strokeEndMarker), StrCast(this.layoutDoc.strokeDash), scaleX, scaleY, "", "none", this.props.isSelected() && strokeWidth <= 5 && lineBot - lineTop > 1 && lineRgt - lineLft > 1, false); @@ -170,8 +183,8 @@ export class InkingStroke extends ViewBoxBaseComponent - { formatInstance.addPoints(pts.X, pts.Y, apoints, i, controlPoints); }} pointerEvents="all" cursor="all-scroll" + { formatInstance.addPoints(pts.X, pts.Y, apoints, i, controlPoints); }} onMouseEnter={() => this.onPointerEnter(i)} onMouseLeave={this.onPointerLeave} pointerEvents="all" cursor="all-scroll" /> ); // Blue circles that allow the user to edit the curvature of the line using the selected control point as the anchor. -- cgit v1.2.3-70-g09d2