-
Notifications
You must be signed in to change notification settings - Fork 118
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
Port to the Parley cursor rework #755
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @dfrg it seems like something has changed with line height? Is this expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn’t change individual line height but updated the overall layout dimensions to use the max_coord of each line so that the layout box encompasses the full text. There’s obviously something funky going on with how line metrics are calculated because these should be the same but the web compatible line height changes added some complex interactions and I haven’t had time to investigate that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I've just done some quick testing, and descenders still seem to be cut off when clipping to the layout box. See also https://xi.zulipchat.com/#narrow/channel/205635-text/topic/Some.20funny.20typography.20with.20Masonry
c23a9da
to
f12569a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for reviewers: These changes are only ports of changes done in linebender/parley#170, except for the set_width hack
My quick accessibility tests are all working. |
Wrote too soon. I just caught two accessibility bugs that were probably actually introduced in #616:
|
Ouch... that's a really embarrassing mistake. I think this was #754 Thanks for the clarification on point 2. I think a tiny bit of documentation would be good. |
Looks like I need to modify Parley to take the scale factor into account when calculating the run bounding rectangles and character widths for AccessKit. |
Alternatively, I could eliminate the need to apply the scale factor to individual node bounding rectangles, which would complicate the Parley API, if I instead modify Masonry to set an AccessKit transform on the root node. |
I think that would be the idiomatic way within the current form of Xilem (there is a future question about pixel alignment)... |
OK, let's land #764, then rebase this, and then you won't need to include the scale factor when calculating the x and y offsets. |
I've had to add a hack to workaround a (new)? Parley bug where an empty initial text causes a crash Note that later setting the text to be empty does not reproduce the crash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm able to edit the text of Prose
through selection and space, but I don't think that's an issue introduced here.
b6bedd7
to
e2283eb
Compare
Now my quick accessibility tests all pass. |
The upstream PR has now been merged: linebender/parley#170
I've had to add a hack to workaround linebender/parley#186. This occurs because of the first pass of layout with zero available area.