#1377 Show snap preview when drawing lines near stations#1379
Open
Unnamed2964 wants to merge 1 commit intorailmapgen:mainfrom
Open
#1377 Show snap preview when drawing lines near stations#1379Unnamed2964 wants to merge 1 commit intorailmapgen:mainfrom
Unnamed2964 wants to merge 1 commit intorailmapgen:mainfrom
Conversation
…1377) When creating a line, if the pointer is within LINE_SNAP_RADIUS (20 SVG units) of a connectable node, the temporary line snaps to that station and a cyan circle indicator appears at the snap target. - Add LINE_SNAP_RADIUS constant in canvas.ts - Add snapTarget state and detection logic in handlePointerMove - Use cyan stroke for snap indicator consistent with snap lines - Use snapTarget in handlePointerUp to guarantee connection when visually snapped
Contributor
Author
1377-2.mp4 |
Contributor
Author
1377-4.mp4 |
Member
|
嗨,看起来效果不错,感谢您的贡献 :) 不过我比较在意但是如果20范围内有多个车站怎么办?以及如果一个车站大于等于20宽度,比如广州地铁换乘车站,效果又会怎样? |
Contributor
Author
|
如果大于20宽度,不会显示贴附效果,但如果在形状范围内仍然会连线,就像原有行为一样 |
Contributor
Author
|
20范围内如果有多个车站,会选最近的车站 |
Contributor
Author
这可能会给用户造成一定困扰(?)因为现在是显示贴附效果可以推出能够成功建立线段,但是成功建立线段不一定在创建时显示贴附效果。 |
Contributor
Author
|
有空的话我会测试一下那两种情况 |
Contributor
Author
1377-6.mp4 |
Contributor
Author
1377-8.mp4 |
Contributor
Author
|
1377-6.mp4 的 json: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement #1377
When creating a line, if the pointer is within LINE_SNAP_RADIUS (20 SVG units) of a connectable node, the temporary line snaps to that station and a cyan circle indicator appears at the snap target.