fix(graph): 支持关闭网格自动吸附#5080
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for disabling automatic grid snapping via a new grid.snapToGrid option, updating the coordinate manager, drag-and-drop plugin, transform plugin, and node view to respect this setting. However, a bug was identified in the drag-and-drop plugin (src/plugin/dnd/index.ts) where the logic for shouldSnapToGrid incorrectly snaps the node to the grid when this.snapOffset is truthy, which would override and break snapline alignment. A correction has been suggested to ensure grid snapping is only applied when this.snapOffset is falsy.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
What is changed
snapToGridsupport to grid options.{ size: 10 }.Tests
pnpm exec vitest run __tests__\graph\graph.spec.ts __tests__\graph\coord.spec.ts __tests__\view\node\index.spec.ts __tests__\plugin\dnd.spec.ts __tests__\plugin\transform.spec.tspnpm exec tsc --noEmit