Sign in

    layout

    Pure reusable layout core extracted from mizchi/crater

    Download zip
    Author
    Version
    0.1.2
    License
    Apache-2.0
    Last updated
    8 months ago
    Downloads
    32K

    Dependencies

    #mizchi/moonbit_template

    apply_aspect_ratio_after_constraints

    fn apply_aspect_ratio_after_constraints(width : Double, height : Double, aspect_ratio : Double?, width_has_constraint : Bool, height_has_constraint : Bool) -> (Double, Double)

    clamp_size

    fn clamp_size(width : Double, height : Double, min_w : Double, max_w : Double, min_h : Double, max_h : Double) -> (Double, Double)

    clamp_size_with_box_min

    fn clamp_size_with_box_min(width : Double, height : Double, style_min_w : Double, max_w : Double, style_min_h : Double, max_h : Double, box_min_w : Double, box_min_h : Double) -> (Double, Double)

    clamp_value

    fn clamp_value(value : Double, min_val : Double, max_val : Double) -> Double

    compute_align_offset

    fn compute_align_offset(align :
    Alignment
    , free_space : Double) -> Double

    compute_align_self_offset

    fn compute_align_self_offset(align_self :
    AlignSelf
    , parent_align :
    Alignment
    , free_space : Double) -> Double

    compute_justify

    fn compute_justify(justify :
    Alignment
    , free_space : Double, item_count : Int) -> (Double, Double)

    resolve_auto_margin_pair

    fn resolve_auto_margin_pair(start_is_auto : Bool, end_is_auto : Bool, fixed_start : Double, fixed_end : Double, remaining_space : Double) -> (Double, Double)

    resolve_relative_inset_axis_offset

    fn resolve_relative_inset_axis_offset(start :
    Dimension
    , end :
    Dimension
    , percent_context : Double?) -> Double

    resolve_relative_inset_offsets

    fn resolve_relative_inset_offsets(inset :
    Rect
    [
    Dimension
    ], width_context : Double, height_context : Double?) -> (Double, Double)

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io