-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix line bugs #1936
fix line bugs #1936
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
remove the initial 0.1 offset when dragging a new line, this helps pass the tests
this.editor.setCurrentTool('select.dragging_handle', { | ||
shape: this.shape, | ||
isCreating: true, | ||
handle: last(handles)!, | ||
handle: { ...lastHandle, x: lastHandle.x - 0.1, y: lastHandle.y - 0.1 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks weird.
The end handle is initially set to the pos 0.1, 0.1 . When shift clicking, we update the position of the end handle to a new point on the second click. But, when clicking then dragging we actually need to shave this offset off somehow (the branch was failing Line Tool tests and any snapshot tests that drew lines without this change). This was what I came up with, but there may be a better way.
…n the toolbar (tldraw#1459) Disable `g` keyboard shortcut in readonly mode. Show laser tool in toolbar when in readonly mode. Resolves [tldraw#1936](tldraw/brivate#1936) Resolves [tldraw#1935](tldraw/brivate#1935) ### Change Type - [x] `patch` — Bug Fix ### Test Plan 1. Open a readonly room. 2. Press `g` and make sure it doesn't switch to it. 3. Laser tool should be visible in the toolbar in readonly rooms. ### Release Notes - Disable geo tool shortcut in readonly mode. Show laser on the toolbar. --------- Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
closes #1913
Some lines aren't rendering:

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
patch
— Bug fixminor
— New featuremajor
— Breaking changedependencies
— Changes to package dependencies1documentation
— Changes to the documentation only2tests
— Changes to any test code only2internal
— Any other changes that don't affect the published package2Test Plan
Release Notes
Before & After:
Footnotes
publishes a
patch
release, for devDependencies useinternal
↩will not publish a new version ↩ ↩2 ↩3