Repository: typst/typst
File: crates/typst-layout/src/math/underover.rs (Rust)

Code before:
            baseline = content.ascent() + extra_height;
            line_adjust = Abs::zero();
        }
    }

    let width = content.width();
    let height = content.height() + extra_height;
    let size = Size::new(width, height);
    let line_width = width + line_adjust;

    let content_class = content.class();
    let content_is_text_like = content.is_text_like();
    let content_italics_correction = content.italics_correction();
    let mut frame = Frame::soft(size);
    frame.set_baseline(baseline);
    frame.push_frame(content_pos, content.into_frame());

    let text_fill = styles.get_ref(TextElem::fill).as_decoration();
    let line = match styles.get_ref(TextElem::stroke) {
        Some(stroke) => Geometry::Rect(Size::new(line_width, thickness))
            .filled_and_stroked(
                text_fill.clone(),
                FixedStroke::from_pair(
                    stroke.paint.clone().unwrap_or(text_fill),
                    stroke.thickness.resolve(styles).unwrap_or(Abs::pt(1.0)),
                ),
            ),
        None => Geometry::Line(Point::with_x(line_width))
            .stroked(FixedStroke::from_pair(text_fill, thickness)),
    };
    frame.push(line_pos, FrameItem::Shape(line, span));

    ctx.push(
        FrameFragment::new(styles, frame)
            .with_class(content_class)
            .with_text_like(content_is_text_like)
            .with_italics_correction(content_italics_correction),
    );

    Ok(())
}

/// Layout an over- or underbrace-like object.
fn layout_underoverspreader(
    ctx: &mut MathContext,
    styles: StyleChain,
    body: &Content,
    annotation: &Option<Content>,
    c: char,
    position: Position,
    span: Span,

Review comment (suggestion):
```suggestion
                stroke.clone().resolve(styles).unwrap_or_default(),
```

Code after:
            baseline = content.ascent() + extra_height;
            line_adjust = Abs::zero();
        }
    }

    let width = content.width();
    let height = content.height() + extra_height;
    let size = Size::new(width, height);
    let line_width = width + line_adjust;

    let content_class = content.class();
    let content_is_text_like = content.is_text_like();
    let content_italics_correction = content.italics_correction();
    let mut frame = Frame::soft(size);
    frame.set_baseline(baseline);
    frame.push_frame(content_pos, content.into_frame());

    let text_fill = styles.get_ref(TextElem::fill).as_decoration();
    let line = match styles.get_ref(TextElem::stroke) {
        Some(stroke) => Geometry::Rect(Size::new(line_width, thickness))
            .filled_and_stroked(
                text_fill.clone(),
                stroke.clone().resolve(styles).unwrap_or_default(),
            ),
        None => Geometry::Line(Point::with_x(line_width))
            .stroked(FixedStroke::from_pair(text_fill, thickness)),
    };
    frame.push(line_pos, FrameItem::Shape(line, span));

    ctx.push(
        FrameFragment::new(styles, frame)
            .with_class(content_class)
            .with_text_like(content_is_text_like)
            .with_italics_correction(content_italics_correction),
    );

    Ok(())
}

/// Layout an over- or underbrace-like object.
fn layout_underoverspreader(
    ctx: &mut MathContext,
    styles: StyleChain,
    body: &Content,
    annotation: &Option<Content>,
    c: char,
    position: Position,
    span: Span,
) -> SourceResult<()> {
    let body = ctx.layout_into_fragment(body, styles)?;
    let body_class = body.class();