render: shape atomic generated controls

This commit is contained in:
SGavrl committed 2026-07-26 21:51:34 +00:00
1 parent 9ffc071ce0
commit 237ba35639
6 files changed
+271 -26

No files matched your search

+10
View File
@@ -804,6 +804,16 @@ pub(crate) fn to_taffy_style(style: &LayoutStyle) -> Style {
s.align_content = style.align_content;
if let Some(jc) = style.justify_content {
s.justify_content = Some(jc);
} else if style.is_inline_block {
// Taffy's inline-box stand-in is a wrapping flex row. `text-align`
// aligns each line of an inline-block's internal formatting context;
// map that inherited value onto the row axis without affecting how
// the atomic box itself participates in its parent's inline flow.
s.justify_content = match style.text_align {
Some(taffy::AlignItems::CENTER) => Some(taffy::JustifyContent::CENTER),
Some(taffy::AlignItems::FLEX_END) => Some(taffy::JustifyContent::FLEX_END),
_ => None,
};
}
if let Some(fg) = style.flex_grow {
s.flex_grow = fg;