73e61727cc
closes #1913 Some lines aren't rendering: <img width="500" alt="shapes" src="https://github.com/tldraw/tldraw/assets/98838967/bd01bb0f-a967-46ce-9056-a81421224931"> When we begin drawing a line it's nice for the user to be able to see a dot, so we put down two points. The end point for a new line was set to the same position as the first point, which was causing a bunch of divide by zero errors. Offsetting it slightly fixes that. Now when two handles are too close together we extend the second one instead of drawing a third. This will probably only ever happen with the first two points of a line. ### Change Type - [x] `patch` — Bug fix - [ ] `minor` — New feature - [ ] `major` — Breaking change - [ ] `dependencies` — Changes to package dependencies[^1] - [ ] `documentation` — Changes to the documentation only[^2] - [ ] `tests` — Changes to any test code only[^2] - [ ] `internal` — Any other changes that don't affect the published package[^2] - [ ] I don't know [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version ### Test Plan 1. Select the Line tool and set spline to line and dash to draw 2. Click around the canvas 3. You should now be able to actually see a line 4. Now set spline to cubic and dash to solid 5. shift click around the canvas 6. You should be able to see a line! ### Release Notes - This PR patches a couple of bugs which led to straight draw lines and beziered dash lines not rendering on the canvas Before & After: <image width="250" src="https://github.com/tldraw/tldraw/assets/98838967/e0ca7d54-506f-4014-b65a-6b61a98e3665" /> <image width="250" src="https://github.com/tldraw/tldraw/assets/98838967/90c9fa12-1bcb-430d-80c7-97e1faacea16" /> --------- Co-authored-by: Steve Ruiz <steveruizok@gmail.com> |
||
---|---|---|
.. | ||
assets | ||
editor | ||
state | ||
store | ||
tldraw | ||
tlschema | ||
utils | ||
validate |