src/util/freehand/FreehandLineFinder.js
/**
   * Looks for lines near the mouse cursor.
   *
   * @public
   * @method
   * @returns {ClickedLineData} Data object corresponding to the clicked line.
   */
Looks for lines near the mouse cursor.
@public
@method
@returns {ClickedLineData} Data object corresponding to the clicked line.
Looks for lines near the mouse cursor . @public @method @returns { ClickedLineData } Data object corresponding to the clicked line .
findLine() {
    const closestToolIndex = this.findTool();
    if (closestToolIndex === null) {
      return null;
    }
    const closeLines = this._getCloseLinesInTool(closestToolIndex);
    if (closeLines) {
      const clickedLineData = this._findCorrectLine(
        closestToolIndex,
        closeLines
      );
      return clickedLineData;
    }
    return null;
  }
findLine ( ) { const closestToolIndex = this . findTool ( ) ; if ( closestToolIndex === null ) { return null ; } const closeLines = this . _getCloseLinesInTool ( closestToolIndex ) ; if ( closeLines ) { const clickedLineData = this . _findCorrectLine ( closestToolIndex , closeLines ) ; return clickedLineData ; } return null ; }
Looks for lines near the mouse cursor.
Looks for lines near the mouse cursor .
// Note: clickedLineData may be null if no valid projections are found. // Return null if no valid close lines found.