Repository navigation
fix(erd): edge label readable at any zoom, hover tolerance in screen px, Mermaid FK ends (#1156) - #1203
Merged
Conversation
…px, Mermaid FK ends (#1156) The edge label lived inside the zoomed canvas: at the fit zoom of a large schema it shrank to an unreadable size, at 300 % it tripled. It is now drawn above the canvas in screen space and follows pans and zooms. The 6 px hover tolerance was in canvas units, so an edge was hard to hit when zoomed out and too easy to hit when zoomed in; it is now 6 screen px. Mermaid wrote every relation as zero or many; a NOT NULL foreign key is now one or many, as the screen and the SVG draw it.
#1156) A CustomPaint is hit everywhere unless its painter says otherwise, and a Stack stops at the first child hit. The edge painter sat above the hover layer, so the hover layer never saw the pointer and the edge label never showed. The new hover test caught it.
3 tasks
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.
Closes #1156
What was wrong
Nullability loading, the card's
type?marker and the circle / bar edge ends (screen and SVG) were already in place. Still broken:CustomPaintsat above the hover layer and is hit everywhere by default, so the hover layer never saw the pointer. The hover existed in code but did nothing in the app.||--o{(zero or many), so the export did not tell a nullable FK from a NOT NULL one, while the screen and the SVG did.Changes
hitTestreturns false), so hovering an edge reaches the hover layer.||--|{for a NOT NULL foreign key,||--o{for a nullable one. This matches the circle at the FK end on screen, as the issue specifies.orders.user_id → users.id, and after zooming out the label keeps its screen size. Mermaid is checked for both nullable and NOT NULL.