Skip to content

Commit

Permalink
fix: do not grid snap when draw selection
Browse files Browse the repository at this point in the history
  • Loading branch information
F-star committed Jun 12, 2024
1 parent 31092e6 commit 5102467
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/core/src/tools/tool_select/tool_select_selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { getRectByTwoPoint, type IPoint } from '@suika/geo';
import { type Editor } from '../../editor';
import { type SuikaGraphics } from '../../graphs';
import { getParentIdSet } from '../../service/group_and_record';
import { SnapHelper } from '../../snap';
import { type IBaseTool } from '../type';
import { getElementsInSelection } from './utils';

Expand Down Expand Up @@ -36,21 +35,15 @@ export class DrawSelection implements IBaseTool {
this.editor.selectedElements.clear();
}

this.startPoint = SnapHelper.getSnapPtBySetting(
this.editor.getSceneCursorXY(e),
this.editor.setting,
);
this.startPoint = this.editor.getSceneCursorXY(e);

this.editor.render();
this.editor.sceneGraph.setSelection(this.startPoint);
}
onDrag(e: PointerEvent) {
this.lastMouseScenePoint = this.editor.getSceneCursorXY(e);

this.lastMousePoint = SnapHelper.getSnapPtBySetting(
this.lastMouseScenePoint,
this.editor.setting,
);
this.lastMousePoint = this.lastMouseScenePoint;

this.updateSelection();
}
Expand Down

0 comments on commit 5102467

Please sign in to comment.