Skip to content

Commit

Permalink
decrease minimum step size for lasso select
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator committed Jan 5, 2025
1 parent bf012ee commit f91b894
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [];
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit f91b894

Please sign in to comment.