fix(onet): make the connecting line visible - #306
Merged
Conversation
The line was drawn but invisible: strokeWidth 0.14 combined with vectorEffect='non-scaling-stroke' meant 0.14 SCREEN pixels, not 0.14 cells. The overlay was also mispositioned — its hand-picked -8%/116% offsets didn't match the viewBox (8 columns needs -12.5%/125%) and ignored the grid's gap and padding. Now the path is converted to pixel centres measured from the real cells (extrapolating the cell pitch for the one-cell margin), drawn in the grid's own pixel space with overflow visible, so it lines up exactly at any board size and routes that leave the board still show. Added a dark halo behind the line plus endpoint dots for contrast on any tile, and lengthened the flash from 240ms to 420ms so it is actually seen.
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.
You were right — no line appeared on a match. Two bugs:
1. The line was invisible, not missing.
strokeWidth={0.14}combined withvectorEffect="non-scaling-stroke"means 0.14 screen pixels, not 0.14 cells. It was rendering the whole time, just sub-pixel thin.2. The overlay was mispositioned. Its hand-picked
-8% / 116%offsets didn't match the viewBox (8 columns needs-12.5% / 125%) and ignored the grid's 2px gap and padding — so even at a visible width it would have been off.Fix: the path is now converted to pixel centres measured from the real cells (extrapolating the cell pitch to handle the one-cell margin) and drawn in the grid's own pixel space with
overflow-visible. That lines up exactly at any board size or difficulty, and routes that leave the board still render. Added a dark halo behind the line plus endpoint dots so it reads on any tile colour, and lengthened the flash 240ms → 420ms.Verified in a browser, not just asserted: captured mid-flash, the polyline renders
101.5,34.5 → 101.5,-32.5 → 369.5,-32.5 → 369.5,34.5— a 2-turn route going up out of the board and back down (negative y = the outside margin), 268×67px.Note: because a route can legitimately travel outside the board, the flash briefly overlaps the stat chips above the grid. I left it — it actually communicates the outside-border rule, and reserving a full cell of clearance would cost ~67px of permanent dead space. Happy to add clearance if you'd rather.