Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle clipping of characters in CHTML better and avoid vertical scroll bars for overflow="scroll" #1171

Open
wants to merge 2 commits into
base: woff2
Choose a base branch
from

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Nov 24, 2024

This PR introduces clipping paths for the CHTML characters so that when selected, they highlight region will match the character bounding box (rather than having excessive depth, for example). It also clips the spaces used for in-line breaking so that they don't show selection, just as the spacing for non-breakpoints doesn't show.

This clipping makes the focus outline match the bounding box better, particularly for the explorer on in-line expressions (the outline used to be excessively below the expression). This necessitated some changes to the CSS for inline breaking, and requires one more rule to be in the font-specific CSS, so I had to rebuild all the fonts. You will need to use the woff2 version of the lab to test this (as this is build on top of the woff2 branch).

I also normalized the size of the explorer outline so that the HTML and SVG versions are more consistent (so slightly smaller outline in CHTML and slightly larger in SVG). I always thought the CHTML outline was too heavy anyway.

I also moved some CSS that was common to both CHTML and SVG to the common.ts file, for easier maintenance.

Finally, when overflow is either scroll or truncate, the overflow-y CSS is set to clip, to avoid unwanted vertical scroll bars.

… better, and explorer outline avoids extra depth, particularly in in-line mode. Avoid vertical scroll bar for wide expressions with overflow=Scroll. Move some common CSS to common.ts
@dpvc dpvc requested a review from zorkow November 24, 2024 11:18
@dpvc dpvc added this to the v4.0 milestone Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant