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

Don't apply linePadding to line areas with zero background area #17

Open
wants to merge 10 commits into
base: smp-master
Choose a base branch
from

Conversation

nigelmegitt
Copy link
Collaborator

Fixes the linePadding3 render to be the same as before, whether that is right or wrong!

This PR results from the discussion following sandflow#216 (comment)

Fixes the linePadding3 render to be the same as before, whether that is right or wrong!
Fixes an issue where linePadding sometimes didn't appear on one side or the other, and reduces the test differences still further.
It is needed to correctly inset when linePadding is applied.
if (se === ee) {

// Check to see if there's any background at all
elementBoundingRect = se.node.getBoundingClientRect();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work – elementBoundingRect doesn't have a var – but it's like this upstream, so I don't know how this fixes anything, unless the exception fixing it by stopping it going further when se === ee?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, might be my bad habit of not declaring the var. It's been a while but I'm pretty sure this code fixed a test case at some point.

The intent of the code is to avoid adding line padding background in the inline direction to a line that contains no content, and therefore has no background area to extend. It checks for either width = 0 or height = 0 rather than jumping through other hoops trying to work out the writing direction.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e671704.

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.

2 participants