Repository navigation
fix: the word on a link sits on its curve - #174
Merged
Merged
Conversation
It was put at the middle of the straight line between the link's ends, which a curve that leaves by a side and arrives from below runs well clear of: the count on a token link hung in the air beside it. Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
…rd is tested where it is drawn From the review of #174. - Two links that leave a node side by side still run together halfway, so their words landed within a few pixels of each other once each sat on its own curve. A word now moves a little along its curve when the word of a link placed before it is already there. - The test of the drawing used a straight link, whose middle is the same either way: it passed with the old placement. It now uses a link bent by a neighbour of its frame. Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
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.
A small correction to the links drawn on selection (#171), seen on a real render of a CalPy actor: the count on a token link (
×1) hung in the air some 80 px from its link.What changes
The word of a link was put at the middle of the straight line between the link's two ends. A link is a curve that leaves a node straight out of one side and arrives straight into a side of the other, so where those sides are not facing each other the curve runs well clear of that point. The word is now at the middle of the curve itself (the cubic at t = 0.5, from the same two control points the path is drawn with).
Checked
test/selection-links.test.ts: the middle is on the drawn curve; for a bowed link it is more than 40 px from the old place; for a straight link it is the middle of its line; the drawing puts the word there.After review
An independent review checked the geometry for all sixteen pairs of sides against the drawn path, and swept 20,000 random fans of three labelled links. Nothing to fix before merge; two things taken from it:
In the sweep, words over a node fell from 1,098 to 831; words more than 12 px off their own curve were 14,201 of 60,000 before this change.
https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv