Repository navigation
Allow edge shift to be a (start, end) pair - #179
Open
NeilGirdhar wants to merge 1 commit into
Open
NeilGirdhar wants to merge 1 commit into
NeilGirdhar wants to merge 1 commit into
Conversation
Fletcher 0.5 accepted `shift: (start, end)`, and 0.6 dropped it when shift became a whole-path offset. Separate end shifts are the natural way to fan several edges into or out of one node, so diagrams that relied on them have no direct replacement in 0.6. A pair moves the edge's vertices before snapping, so the shifted ends still meet node outlines. Equal values give the same path as a single shift for lines, arcs, corners, and polylines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Yes, this is AI generated, and apologies for it! Just a starting point in case you're interested in reviving this feature. |
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.
Fletcher 0.5 accepted
shift: (start, end)to shift each end of an edge separately. 0.6 madeshifta whole-path offset and dropped the pair, so diagrams that fan several edges into or out of one node have no direct replacement after upgrading. This PR brings the pair back, built on 0.6's edge pipeline.Behaviour
lineedges with three or more vertices): the first leg moves bystart, the last byend, and legs in between by amounts stepping evenly between the two. Each corner goes where its two offset legs meet, so every leg stays parallel to the original.bend,corner, Bézier and custom kinds): each end vertex moves perpendicular to the path's direction at that end, and the kind redraws the path through the moved ends. An arc keeps its bend angle.Difference from 0.5
On a polyline with three or more legs, 0.5 moved only the first and last legs. Here the legs in between move too, which is what makes equal values match the 0.6 single shift. Two-leg edges with right-angle corners come out the same as in 0.5.
Changes
paths.end-directions: the direction of travel at each end of a drawable.edges.apply-end-shifts: moves the vertices, called fromdraw-edgebefore snapping.get-edge-drawablemoves out ofapply-edge-snappingsodraw-edgecan share it.shiftdocstring documents the pair and adds an example.tests/edge/shift.Testing
tt run: all 51 tests pass, and theedge/shiftreference image is updated.🤖 Generated with Claude Code