1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

LibWeb: Add an initial implementation of SVG text-anchor

This only handles very simple <text> elements, but this is enough (with
the font-size changes) to improve the badges on the GitHub README a fair
bit.
This commit is contained in:
MacDue 2023-07-19 19:12:00 +01:00 committed by Andreas Kling
parent 4cdb4de049
commit 30277f385c
10 changed files with 77 additions and 0 deletions

View file

@ -724,6 +724,9 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style)
computed_values.set_stroke_opacity(computed_style.stroke_opacity());
computed_values.set_stop_opacity(computed_style.stop_opacity());
if (auto text_anchor = computed_style.text_anchor(); text_anchor.has_value())
computed_values.set_text_anchor(*text_anchor);
computed_values.set_column_gap(computed_style.size_value(CSS::PropertyID::ColumnGap));
computed_values.set_row_gap(computed_style.size_value(CSS::PropertyID::RowGap));