diff --git a/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/LassoSelectionBuilder.ts b/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/LassoSelectionBuilder.ts index dc064625..cbf301ad 100644 --- a/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/LassoSelectionBuilder.ts +++ b/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/LassoSelectionBuilder.ts @@ -7,7 +7,7 @@ import AbstractComponent from '../../../components/AbstractComponent'; import SelectionBuilder from './SelectionBuilder'; /** - * Renders a preview of the current selection. + * Creates lasso selections. */ export default class LassoSelectionBuilder extends SelectionBuilder { private boundaryPoints: Point2[] = []; @@ -25,7 +25,7 @@ export default class LassoSelectionBuilder extends SelectionBuilder { public onPointerMove(canvasPoint: Point2) { const lastBoundaryPoint = this.boundaryPoints[this.boundaryPoints.length - 1]; - const minBoundaryDist = this.viewport.getSizeOfPixelOnCanvas() * 15; + const minBoundaryDist = this.viewport.getSizeOfPixelOnCanvas() * 8; if (lastBoundaryPoint.distanceTo(canvasPoint) >= minBoundaryDist) { this.boundaryPoints.push(canvasPoint); } diff --git a/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/RectSelectionBuilder.ts b/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/RectSelectionBuilder.ts index 691d03ff..0f446bb4 100644 --- a/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/RectSelectionBuilder.ts +++ b/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/RectSelectionBuilder.ts @@ -3,7 +3,7 @@ import EditorImage from '../../../image/EditorImage'; import SelectionBuilder from './SelectionBuilder'; /** - * Renders a preview of the in-progress rectangular selection. + * Creates rectangle selections */ export default class RectSelectionBuilder extends SelectionBuilder { private rect: Rect2; diff --git a/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/SelectionBuilder.ts b/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/SelectionBuilder.ts index c7736da4..9649711b 100644 --- a/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/SelectionBuilder.ts +++ b/packages/js-draw/src/tools/SelectionTool/SelectionBuilders/SelectionBuilder.ts @@ -8,6 +8,8 @@ import Viewport from '../../../Viewport'; export default abstract class SelectionBuilder { public abstract onPointerMove(canvasPoint: Point2): void; public abstract previewPath(): Path; + + /** Returns the components currently in the selection bounds. Used by {@link resolve}. */ protected abstract resolveInternal(image: EditorImage): AbstractComponent[]; /** Renders a preview of the selection bounds */