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

Use dominant-baseline if alignment-baseline is missing & Apply context on text nodes #286

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

giroletm
Copy link

@giroletm giroletm commented May 7, 2024

Fixes #80 by falling back on dominant-baseline if alignment-baseline is unspecified.

Note that according to MDN, if dominant-baseline is defined within a parent and a child sets its alignment-baseline to baseline, it should be equivalent to the same value as the parent's dominant-baseline.

This specific case is not supported here. All this PR does is allow the usage of dominant-baseline on text nodes. Child nodes are not considered.

This PR also applies the current context before rendering a text node, since this was previously not done, causing adjacent text nodes that uses different font styles to use the same one.

…ctx fix

Fixes yWorks#80
Applies the current context before rendering a text node
@giroletm giroletm changed the title Use dominant-baseline if alignment-baseline is missing & Apply context on text nodes Use dominant-baseline if alignment-baseline is missing & Apply context on text nodes May 7, 2024
@giroletm giroletm changed the title Use dominant-baseline if alignment-baseline is missing & Apply context on text nodes Use dominant-baseline if alignment-baseline is missing & Apply context on text nodes May 7, 2024
Copy link
Member

@HackbrettXXX HackbrettXXX left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. Please add a test case.

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.

text dominant-baseline not working
2 participants