Skip to content

Commit

Permalink
feat: Show delete menu for the start/last vertices of a line
Browse files Browse the repository at this point in the history
  • Loading branch information
miyanokomiya committed Apr 11, 2024
1 parent a0c88b8 commit 7baced0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/composables/states/appCanvas/lines/lineSelectedState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,8 @@ export const newLineSelectedState = defineIntransientState(() => {
return handleIntransientEvent(ctx, event);
}
case "contextmenu": {
const vertices = getLinePath(lineShape);
const hitResult = lineBounding.hitTest(event.data.point, ctx.getScale());
if (hitResult?.type === "vertex" && hitResult.index !== 0 && hitResult.index !== vertices.length - 1) {
if (hitResult?.type === "vertex") {
ctx.setContextMenuList({
items: [
{ ...CONTEXT_MENU_ITEM_SRC.DELETE_LINE_VERTEX, meta: { index: hitResult.index } as DeleteVertexMeta },
Expand Down

0 comments on commit 7baced0

Please sign in to comment.