rhwp 0.9.1

HWP/HWPX document engine for Rust applications, WebAssembly, and CLI automation
Documentation
//! 저장 줄이 없는 인라인 호스트를 측정·배치의 같은 프레임에 연결한다.

use super::{line_breaking, Control, Paragraph};

pub(super) fn supports_uncached_inline_host(para: &Paragraph) -> bool {
    if !crate::renderer::para_has_no_stored_line_segs(para) {
        return false;
    }
    let mut has_inline_object = false;
    for control in &para.controls {
        match control {
            Control::Equation(equation) if equation.common.treat_as_char => {
                has_inline_object = true;
            }
            Control::Picture(picture) if picture.common.treat_as_char => {
                has_inline_object = true;
            }
            marker if line_breaking::control_is_width_neutral_marker(marker) => {}
            // 줄 폭을 바꾸지 않는 부동 그림·도형은 자기 상자만 부동 개체 소유자가 배치한다.
            // 사양하면 같은 문단의 글자처럼 개체가 이 프레임의 줄 높이를 잃는다(#8271).
            float if line_breaking::control_is_line_width_neutral_float_object(float) => {}
            // 어울림 도형은 줄이 아예 없을 때만 받는다. 구현 태그 줄이 있으면 밴드 소유자
            // (`layout_picture_band`)가 깎은 줄이다 — 밴드 없는 이 프레임이 다시 채우면 전폭이
            // 된다(#8399).
            shape
                if para.line_segs.is_empty()
                    && line_breaking::control_is_float_shape_beside_text(shape) => {}
            // 표·폭을 바꾸는 부동 개체·중첩 흐름은 각각의 기존 소유권 계약을 따른다.
            _ => return false,
        }
    }
    has_inline_object
}