89881397b5
Currently, when dragging line handles they'll snap to the outlines of other shapes, but not to their vertices. This can make it hard to snap precisely to certain key places, like the handles of other lines, or the corners of `geo` shapes. This diff adds a new snap type for handles - snapping to points: ![Kapture 2024-02-14 at 16 30 41](https://github.com/tldraw/tldraw/assets/1489520/046109d3-2961-463f-bf71-9350ea1204bc) This adds to the new snapping API so the snapping points can very easily be customised on a shape-by-shape basis. Closes TLD-2198 This PR is part of a series - please don't merge it until the things before it have landed! 1. #2827 2. #2831 3. #2793 4. #2841 (you are here) 5. #2845 ### Change Type - [x] `minor` — New feature ### Test Plan 1. create a line shape 2. drag its handles whilst holding command 3. it should snap to the outlines of other shapes, vertices of other line shapes, and the bounding box corners/center of most 'boxy' shapes (geo, embed, etc) - [x] Unit Tests ### Release Notes - Line handles |
||
---|---|---|
.. | ||
api | ||
src | ||
api-extractor.json | ||
api-report.md | ||
CHANGELOG.md | ||
editor.css | ||
LICENSE.md | ||
package.json | ||
README.md | ||
setupTests.js | ||
tsconfig.json |
tldraw/tldraw
Community
Have questions, comments or feedback? Join our discord or start a discussion.
Distributions
You can find tldraw on npm here.
Contribution
Please see our contributing guide. Found a bug? Please submit an issue.
License
The tldraw source code and its distributions are provided under the tldraw license. This license does not permit commercial use.
If you wish to use this project in commercial product, you need to purchase a commercial license. Please contact us at hello@tldraw.com for more inforion about obtaining a commercial license.
Trademarks
Copyright (c) 2023-present tldraw Inc. The tldraw name and logo are trademarks of tldraw. Please see our trademark guidelines for info on acceptable usage.
Contact
Find us on Twitter at @tldraw or email hello@tldraw.com. You can also join our discord for quick help and support.